0

I have to sort one column of mytable in ascending order but problem is mytable contains some special characters related data. Still I want to sort in ascending order so that it display in proper manner in UI.

enter image description here

Can anyone help me with this?

I have tried using

ORDER BY Item DESC

But it gives me first ABC type rows then {ABC} type rows.Means giving special characters in last

Ankit Mishra
  • 130
  • 11
  • may be check 1by1 char of each row is alphanumeric then remove it and then use sort – nick Sep 06 '18 at 04:19
  • A similar question exists [https://stackoverflow.com/questions/27665049/using-regex-with-like-to-sort-alphabets-first-then-symbols-sql](here), which shows how to use RegEx to sort and filter. It might suit your needs. – awwsmm Sep 06 '18 at 06:26

1 Answers1

0

You can try this for your problem :

select * from mytable ORDER BY REGEXP_REPLACE(Item,'[^[:alnum:]'' '']', NULL) DESC
Ankit Mishra
  • 130
  • 11