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: 40A393FF.3030806@onesystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-sql by date

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