This content has been marked as final. Show 3 replies
In your table, the column will be of VARCHAR2 data type.
Since it is a string, even if it is storing numeric values, it will get ordered as strings
try the below
Edited by: jeneesh on Nov 19, 2012 4:35 PM
select your_column from table1 order by to_number(your_column) asc
The column datatype that you are selecting is not of NUMBER datatype(might be char or varchar2) hence you are getting such result set.
And for this purpose, it is recommended to set datatype of a column appropriately.
For now you can add TO_NUMBER function to column in ORDER BY clause, only if it has data of number type.
Edited by: Ora on 19 Nov, 2012 3:10 AM
Thanks jeenesh and Ora. I got it.