order by [message #587553] |
Mon, 17 June 2013 01:01  |
|
hello Expert
plase help me
I am one table create tt1(A varchar2(6),B number(5));
insert data in this column
tt1
A B
---------------
F1 1
F365 2
F10 3
F65 4
F55 5
Q. how to get order by a column
i wan't to
tt1
A
--------------------
F1
F10
F35
F65
F365
Q. how to get order by a column
i wan't to
tt1
A
--------------------
F0001
F0010
F0035
F0065
F0365
|
|
|
|
|
|
|
Re: order by [message #587566 is a reply to message #587562] |
Mon, 17 June 2013 01:43   |
John Watson
Messages: 8989 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
What did you try, and what was the result? You will not get an answer unless you show that you have made an effort yourself.
|
|
|
Re: order by [message #587593 is a reply to message #587566] |
Mon, 17 June 2013 05:40   |
|
insert data in this column
tt1
A B
---------------
F1 1
F365 2
F10 3
F65 4
F55 5
Q. how to get order by a column
i wan't to
tt1
A
--------------------
F1
F10
F35
F65
F365
Q. how to get order by a column
i wan't to
tt1
A
--------------------
F0001
F0010
F0035
F0065
F0365
i am try to dis query...
|
|
|
Re: order by [message #587595 is a reply to message #587593] |
Mon, 17 June 2013 05:45   |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Michel Cadot wrote on Mon, 17 June 2013 08:33Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
John Watson wrote on Mon, 17 June 2013 08:43What did you try, and what was the result? You will not get an answer unless you show that you have made an effort yourself.
Regards
Michel
[Updated on: Mon, 17 June 2013 05:45] Report message to a moderator
|
|
|
|
|
Re: order by [message #587598 is a reply to message #587596] |
Mon, 17 June 2013 06:23   |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
kanoujiapraveen wrote on Mon, 17 June 2013 12:52Hi Luv ,
Check below query, It should work 
select * from tt1 order by lpad ( substr ( A, 2 ) ,0,4 ) ;
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" or "Preview Quick Reply" button to verify.
Also always post your Oracle version, with 4 decimals.
I'd add you start in this forum by answering (or trying to answer) to someone that is reluctant to follow this forum rules is not a good point for you.
Do you think we are unable to answer? If we don't then there may be a reason, as a new comer, don't go against it.
Regards
Michel
|
|
|
Re: order by [message #587622 is a reply to message #587598] |
Mon, 17 June 2013 08:18   |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
If the column always starts with a single alpha column and the rest is number then
order by to_number(substr(a,2))
|
|
|
|
|