Re: ORDER BY question
От | Michael Glaesemann |
---|---|
Тема | Re: ORDER BY question |
Дата | |
Msg-id | E44B1B2B-C525-44E3-8FF0-1975D62A0FBB@seespotcode.net обсуждение исходный текст |
Ответ на | ORDER BY question ("Christian Paul Cosinas" <cpc@cybees.com>) |
Список | pgsql-sql |
On May 11, 2006, at 21:00 , Christian Paul Cosinas wrote: > For example I have a table like this > > ID Name > 1 A > 1 B > 2 C > 2 D > > And I have a Query like this: > SELECT * FROM table ORDER BY ID. > > Would my result always give me the same order or is there may be a > possible > different result? It may give you a different result: if the order is not explicitly specified by the ORDER BY clause, you are not guaranteed to get the rows back in any particular order. So for cases where you may not be ordering on a unique column (such as above), you may want to do something like: SELECT * FROM table ORDER BY "ID", "Name"; Hope this helps. Michael Glaesemann grzm seespotcode net
В списке pgsql-sql по дате отправления: