Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Mon, 29 Dec 2003 08:44:17 +0800
  • Message-id: <3FEF78E1.9020100@familyhealth.com.au> <text/plain>

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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group