Single quote output in sql

Table values

CNAME

Firstname
Amount
PostalCode
Lastname
Account Number

REQUIRED O / P

CNAME

'Name'
'Amount'
'' PostalCode
'LastName'
"Account Number"

-5
source share
1 answer

In mysqlyou can use the function concat():

SELECT CONCAT("'", CNAME, "'") FROM yourTable

In oracleyou can use the same function as above concat()or concatenation operator:

SELECT '''' || CNAME || '''' FROM yourTable;
SELECT CONCAT('''', CNAME, '''') FROM yourTable;
+1
source

Source: https://habr.com/ru/post/1694535/


All Articles