I am querying a table with country names in it.
I want to display the records in the order they were entered with an exception of one.
For example the records were entered in the order
My query should return the names in the following order
Note that USA is displayed at the end of the result set rather than in the order it was entered and all other records are displayed in the order they were entered.
Please suggest how to do this.
What other columns are in the table, can you do a desc on it?
I remember when this place was cool.
Do you have a field that indicates when the record was entered?
Country name is the only column in the table called country.
No there is nothing which tells when the record was entered.
Actually I would say I want to display the countries in the order they are stored in the table with the exception of one that is USA.
The records are not really stored in any order, per se.
Basically, you could use a decode statement to kind of do what you want:
order by decode(country_name,'USA',2,1)
Click Here to Expand Forum to Full Width