Deepti
Deepti

Reputation: 111

Provide quotes for copying in csv from sql

I have the data like below :

 174 ROAD "O" NW

But i want the data like "174 ROAD ""O"" NW"

It means if i have quotes present the new quote should be added in sql query

Upvotes: 0

Views: 22

Answers (1)

Gurwinder Singh
Gurwinder Singh

Reputation: 39477

I guess you can use replace:

select '"' + replace (col, '"', '""') + '"'
from your_table;

Upvotes: 2

Related Questions