hi, when i sort the select results from a database, how can i get rid of the "a, the" troubles.
such as
a canadian hotel British Columbia Motel the airport inn
should be
airport inn british columbia motel a canadian hotel
thanks.
hui
order by case when hotelname like 'a %' then substring(hotelname from 3) when hotelname like 'The %' then substring(hotelname from 5) else hotelname end
The above is standard SQL which may or may not work in your DBMS. If not, please supply the name of the DBMS you are using.
thanks, as the matter of fact, i think i only need to think about the "the" case. i am talking about the sql in general.