Re: DISTINCT ON () with UNION

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql(at)peope(dot)net
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: DISTINCT ON () with UNION
Date: 2001-05-14 00:52:39
Message-ID: 4539.989801559@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

pgsql(at)peope(dot)net writes:
> How can you use a distinct on () including the whole union.

In 7.1 you can write

select distinct ... from (select ... union select ...) ss;

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alexey Nalbat 2001-05-14 07:36:17 Re: can't get rid of unnesesary SORT step in explain plan for hash join
Previous Message pgsql 2001-05-13 23:14:04 DISTINCT ON () with UNION