Reputation: 49
Oracle SQL I want to get one column in order by another column
e.g.
X Y
ab 4
cd 2
ef 3
gh 1
I want column A with order of 2nd
o/p
X
gh
cd
ef
ab
Another thing: I had basically view view1 from another source
select distinct X, Y, Z
from table
order by Y
So I am querying on this view
select X from view1 where z='(:value)'
So does it gurantee it will be in order of y? Or how can I make it in order of y.
Upvotes: 0
Views: 299
Reputation: 1269583
Are you simply looking for order by
?
select x
from t
order by y;
If so, this is very basic SQL and you should study up on the basics if you are attempting to use the language.
Upvotes: 1