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

Re: a wierd query

From: Edmund Bacon <ebacon(at)onesystem(dot)com>
To: sad <sad(at)bankir(dot)ru>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: a wierd query
Date: 2004-05-13 15:27:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
sad wrote:
> select distinct a as F from table
> union
> select distinct b as F from table;

Note that UNION only returns the unique values of the union
You can get repeated values by using UNION ALL.

Edmund Bacon <ebacon(at)onesystem(dot)com>

In response to


pgsql-sql by date

Next:From: Jaime CasanovaDate: 2004-05-13 18:13:23
Subject: isolation level
Previous:From: StefDate: 2004-05-13 14:49:36
Subject: Re: Exceptions when 0 rows affected.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group