Error in Order By SQL STMT [message #233661] |
Fri, 27 April 2007 02:10 |
prathimaprasunrao
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
hello everyone,
I have a table with the following information:
slope code item
2 10-15%
3 15-25%
4 25-50%
5 2-6%
6 6-10%
7 greater than 50%
1 0-2%
I want the order of "item" to be as follows:
0-2%
2-6%
6-10%
10-15%
15-25%
25-50%
Greater than 50%
For that I have written the following query:
select item, slope code from tname order by item asc;
I got the following output:
item slopecode
0-2% 1
10-15% 2
15-30% 3
2-6% 5
25-50% 4
6-10% 6
greaterthan50% 7
I have another table with the following information:
code item
2 Inform
3 observation
4 Subsurface
5 surface
1 historic
6 9999(default value)
So I inserted new item value"metal".This new value displayed in the list box.
7 metal
But I want the order of "items" in the list box to be displayed in the follwoing manner:
Historic
Inform
Metal
Observation
Subsurface
surface
For that I have written the query:
select item, code from tname order by item asc.
but the result of this shows "metal" as the last element in the list box.
Could anyone let me know whats wrong in my sql statement?
Waiting for reply ASAP.
Thanks,
Prathima
|
|
|
|
Re: Error in Order By SQL STMT [message #233678 is a reply to message #233661] |
Fri, 27 April 2007 02:56 |
prathimaprasunrao
Messages: 6 Registered: April 2007
|
Junior Member |
|
|
i wrote the following query:
select item from tname order by item asc;
it displayed values in the following order:
Historic
Inform
Metal
Observation
subsurface
surface.
this is the order which i wanted.
then at the sql prompt,
sql>commit;
it displayed "Commit Complee".
I refreshed the form where i wanted to see this result but I couldn't find this output in the list box i.e., metal still remains the last value in the list box.
Waiting for reply!.
|
|
|
|
Re: Error in Order By SQL STMT [message #233681 is a reply to message #233678] |
Fri, 27 April 2007 03:04 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
It seems you are confusing two things here.
You execute a query and commit in sqlplus, but you are talking about a list-box. (Oracle Forms??)
You should change the query that is used to fill that listbox. In other words: change the code of you application. (your Oracle Form?)
[Updated on: Fri, 27 April 2007 03:04] Report message to a moderator
|
|
|
|
|