View Single Post
  #6 (permalink)  
Old 07-29-09, 16:49
rski rski is offline
Registered User
 
Join Date: Nov 2006
Posts: 82
Quote:
Originally Posted by r937
DISTINCT is ~not~ a function

if you put a column in parentheses after DISTINCT, that does not change what DISTINCT does -- DISTINCT applies to all columns in the SELECT clause

DISTINCT is implemented by a sort on the result set, sorting on all columns, then looking for duplicate rows, i.e. duplicate in all columns
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
Reply With Quote