Using Distinct to sort [message #1115] |
Tue, 02 April 2002 15:21 |
Lisa
Messages: 31 Registered: September 2000
|
Member |
|
|
Does "distinct" perform a sort? And if so, is it by ascending order? Therefore, if I am using "distinct", I do not need to include "order by".
Example:
Select DISTINCT user from user_table;
|
|
|
|
|
Re: Using Distinct to sort [message #1134 is a reply to message #1115] |
Wed, 03 April 2002 09:44 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You always need to include an ORDER BY clause to ensure that your result set is in a particular order.
Although at times it seems you can rely on GROUP BY or DISTINCT to do the "ordering" for you, this is not always the case.
|
|
|