Re: distinct - Mailing list pgsql-general

From bmccoy@chapelperilous.net
Subject Re: distinct
Date
Msg-id Pine.LNX.4.10.10010092145010.4175-100000@chapelperilous.net
Whole thread Raw
In response to distinct  (andrew@networkcomputerz.com)
List pgsql-general
On Tue, 3 Oct 2000 andrew@networkcomputerz.com wrote:

> I have attempted to run
> select distinct col1 from tablename;
> and it runs fine.
>
> When I run it in a real world environment: select distinct col1, col2,
> col3, col4 from tablename order by col1 desc, col2; It returns all the
> values from col1 which appears to be the same thing as not using
> distinct at all.

The DISTINCT constraint applies to all of the columns you are selecting,
not just the first one -- it selects all of the distinct TUPLES from the
query.

Brett W. McCoy
                                              http://www.chapelperilous.net
---------------------------------------------------------------------------
The Kennedy Constant:
    Don't get mad -- get even.



pgsql-general by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: Checking number of entries
Next
From: bmccoy@chapelperilous.net
Date:
Subject: Re: problems in compiling