Re: Show CAS, USD first; the left ordered by currency name

Поиск
Список
Период
Сортировка
От Harald Fuchs
Тема Re: Show CAS, USD first; the left ordered by currency name
Дата
Msg-id pu1vnxkrs1.fsf@srv.protecting.net
обсуждение исходный текст
Ответ на Show CAS, USD first; the left ordered by currency name  (Emi Lu <emilu@encs.concordia.ca>)
Ответы Re: Show CAS, USD first; the left ordered by currency name  (bricklen <bricklen@gmail.com>)
Список pgsql-sql
In article <4A71F9CB.9050805@encs.concordia.ca>,
Emi Lu <emilu@encs.concordia.ca> writes:

> Good morning,
> I have a currency table (code, description).

> Example values:
>  ADF | Andorran Franc
>  ... ...
>  ANG | NL Antillian Guilder
>  AON | Angolan New Kwanza
>  AUD | Australian Dollar
>  AWG | Aruban Florin
>  BBD | Barbados Dollar
>  USD | US Dollar
>  CAD | Canadian Dollar

> Is there a way I can query to display USD AND CAD first, while other
> rows are ordered by Code.

> For example,

> CAS | Canadian Dollar
> USD | US Dollar
> ADF | Andorran Franc
> ...

Probably the shortest solution is
 SELECT code, description FROM currency ORDER BY code != 'CAD', code != 'USD', code;

BTW: your data are obsolete.  Andorra has the Euro.



В списке pgsql-sql по дате отправления:

Предыдущее
От: nha
Дата:
Сообщение: Re: SELECT max(time) group by problem
Следующее
От: bricklen
Дата:
Сообщение: Re: Show CAS, USD first; the left ordered by currency name