Re: sorted result
| От | Einar Karttunen |
|---|---|
| Тема | Re: sorted result |
| Дата | |
| Msg-id | 20011025141930.A24210@cs.helsinki.fi обсуждение исходный текст |
| Ответ на | sorted result ("Al-Haddad, Mohammad J" <mjalha@essex.ac.uk>) |
| Список | pgsql-novice |
On Thu, Oct 25, 2001 at 11:58:39AM +0100, Al-Haddad, Mohammad J wrote: > hi there, > if I have a table T1 with primary key P. and attributes A1,A2 and A3 > and I have this query: > select * form T1 where the P = 123; > > do I get the intermediate relation result sorted based on the primary > key? > > what about if the query somthing like this: > select A1 from T1 where A2 = 456 > > do I get the intermediate result sorted by the primary key > No, all results are returned in a pseudo-random order. If you wish that the resultset is sorted use the ORDER BY-clause. SELECT * FROM T1 WHERE A2=456; pseudo-random order. SELECT * FROM T1 WHERE A2=456 ORDER BY P; sorted. - Einar Karttunen
В списке pgsql-novice по дате отправления: