Re: ORDER BY
| От | Brent Wood |
|---|---|
| Тема | Re: ORDER BY |
| Дата | |
| Msg-id | 455B9490.6060004@niwa.co.nz обсуждение исходный текст |
| Ответ на | Re: ORDER BY (Niklas Johansson <spot@tele2.se>) |
| Список | pgsql-general |
> On 14 nov 2006, at 23.03, MicroUser wrote: >> I need sorted result but the way like this: >> >> 0 | Anna >> 3 | Fernando >> 2 | Link >> 1 | Other >> >> Record '1 | Other' must by at the end of query result. >> >> How I can get it? Something along these lines might work. select * from table where <field> !=1 order desc by <field> union select * from table where <field>=1; or if the last record is always the same, hard code the values in the sql instead of querying the table, which will save a few milliseconds :-) If it is the "other" and not the "1" that you want last, change the first query where clause to where <field> != 'Other' & similarly change the second one. Cheers, Brent Wood
В списке pgsql-general по дате отправления: