View Single Post
  #7 (permalink)  
Old 07-29-09, 16:53
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,083
Quote:
Originally Posted by rski
I'm afraid it is not true. Distinct do not have to aplly to all columns, if you use
Code:
dictinct on (..)
then distinct will apply only to those column you write in parentheses
yes, but....
Quote:
Originally Posted by da postgresql manual
The DISTINCT ON clause is not part of the SQL standard and is sometimes considered bad style because of the potentially indeterminate nature of its results.
my advice is to stay away from non-standard SQL unless there is a real good reason

and this aint one of them

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote