 DISTINCT ON (<TT
CLASS="REPLACEABLE"
><I
>expression</I
></TT
> [<SPAN
CLASS="OPTIONAL"
>, <TT
CLASS="REPLACEABLE"
><I
>expression</I
></TT
> ...</SPAN
>]) <TT
CLASS="REPLACEABLE"
><I
>select_list</I
></TT
> ...</PRE
><P>
    Here <TT
CLASS="REPLACEABLE"
><I
>expression</I
></TT
> is an arbitrary value
    expression that is evaluated for all rows.  A set of rows for
    which all the expressions are equal are considered duplicates, and
    only the first row of the set is kept in the output.  Note that
  