Table Values
CNAME
Firstname
Amount
Postalcode
Lastname
Accountnumber
REQUIRED O/P
CNAME
'Firstname'
'Amount'
'Postalcode'
'Lastname'
'Accountnumber'
Table Values
Firstname
Amount
Postalcode
Lastname
Accountnumber
'Firstname'
'Amount'
'Postalcode'
'Lastname'
'Accountnumber'
In mysql
you can use the function concat()
:
SELECT CONCAT("'", CNAME, "'") FROM yourTable
In oracle
you can use the same function as above concat()
or the concatenation operator
:
SELECT '''' || CNAME || '''' FROM yourTable;
SELECT CONCAT('''', CNAME, '''') FROM yourTable;