Re: select from table with unique values

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: ivan <iv(at)psycho(dot)pl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: select from table with unique values
Date: 2003-12-29 00:44:17
Message-ID: 3FEF78E1.9020100@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> how to do select from same table to get only unique values from same
> column(s) ?

SELECT DISTINCT a, b FROM tab;

or even:

SELECT DISTINCT ON (a) a, b FROM tab;

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Casey Allen Shobe 2003-12-29 01:26:03 Re: Is my MySQL Gaining ?
Previous Message Keith C. Perry 2003-12-28 22:55:09 Re: Is my MySQL Gaining ?