NOTE : I have edited my question because of my input data present in database table.
I have a table and it consists varchar data. The data present inside that column is like this.
"bcd"
cde
abcd
'xxx'
(zzz)
Now I want to sort according to alphabetical order. I have tried this query
select my_col from tbl_user order by ltrim(REPLACE(my_col,'"', '')) ASC
Its’ output is as follows :
'xxx'
(zzz)
abcd
"bcd"
cde
But my desired output is, means while sorting it has to sort according to alphabetical order whether " present or not.
abcd
"bcd"
cde
'xxx'
(zzz)
How can I achieve this??. any ideas.
You could do a replace on the quotes, for example:
But this would add a lot of overhead… maybe there is a built-in solution which would be more efficient.