Home » SQL & PL/SQL » SQL & PL/SQL » help in SQL Sorting (10g)
help in SQL Sorting [message #339015] Wed, 06 August 2008 09:20 Go to next message
Lachmi
Messages: 18
Registered: June 2004
Junior Member
I have a table with a VARCHAR2 column containg values like ('01', '--','002', '001','02','AA','1MA','MM','020'...etc)

The expected output through SQL is

Column1
=======
--
01
001
02
002
020
1MA
AA
MM

i.e. special character '--' should be listed first followed by numbers and then alphanumerics.

Thanks in advance.
Re: help in SQL Sorting [message #339019 is a reply to message #339015] Wed, 06 August 2008 10:09 Go to previous message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use decode/case, substr, instr or other regexp.

Regards
Michel
Previous Topic: can we use an outer joing instead of "NOT IN" and how? any example?
Next Topic: DBMS_RANDOM
Goto Forum:
  


Current Time: Tue Dec 06 12:09:50 CST 2016

Total time taken to generate the page: 0.05844 seconds