- I have a select statement which will return me 5 values as val1,val3,val5,val2,val4
- I have another select statement which is going to return a set of records with one of the column having values from the above set (val1 to val5)
Is it possible to sort the second select statement with the result of the first select statement?
I mean in the order of val1,val3,val5,val2,val4.
This means if the first statement reverses the order I have to reverse the order.
Please let me know if this is possible.
You haven’t posted your actual queries, so I may be assuming they are simpler than they are, but if your first statement was:
then your second query could be
In other words, you could copy the ordering from your first statement to the second.