sorted result

Поиск
Список
Период
Сортировка
Искать

sorted result

От:
"Al-Haddad, Mohammad J" <mjalha@essex.ac.uk>
Дата:
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
 
 
thank you
 
 
 

Re: sorted result

От:
Einar Karttunen <ekarttun@cs.Helsinki.FI>
Дата:
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
FAQ