Re: [GENERAL] Sorting a table...

Поиск
Список
Период
Сортировка
От Stan Jacobs
Тема Re: [GENERAL] Sorting a table...
Дата
Msg-id Pine.LNX.4.05.9911300912230.18406-100000@crease.jtek.com
обсуждение исходный текст
Ответ на Sorting a table...  (Jesse Scott <jscott@bmi.net>)
Список pgsql-general
> Hello all, I'm new to this list so forgive me if this question get's asked
> a lot. (I did search the archives...)

A standard SQL reference might help a lot, since this is more in the
domain of SQL syntax than PostgreSQL help.


> list them out of order (one of the fields is a sequential ID number).  Is
> there anyway to do a "sort by" or something similar?  Or do I need to set
> the ID number to be some sort of index type?

Just add the 'ORDER BY' tag to the end of your query....

    e.g. 'SELECT * FROM users ORDER BY seq_id_number'

... and it will return the results sorted by seq_id_number.  (Of course,
replace this variable with whatever your sequential id number field is
actually called.)


    HTH,

    - Stan -



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

Предыдущее
От: Ed Loehr
Дата:
Сообщение: Re: [GENERAL] Sorting a table...
Следующее
От: Bradford Hovinen
Дата:
Сообщение: Re: [GENERAL] SQL error in PostgreSQL 6.5.3