Re: [HACKERS] Reference Manual]

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: sferac(at)proxy(dot)bazzanese(dot)com (Jose' Soares Da Silva)
Cc: pgsql-hackers(at)postgreSQL(dot)org, pgsql-docs(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Reference Manual]
Date: 1998-03-30 15:25:03
Message-ID: 199803301525.KAA13181@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2. - Seems that optional ALL keyword of UNION doesn't work.
> The following query prints always the same result with and without
> the ALL clause.
>
> * UNION of two tables:
>
> mytable: yourtable:
> id|name id|name
> --+------ --+------
> 1|Smith 1|Soares
> 2|Jones 2|Panini
> 3|Soares
>
>
> SELECT mytable.id, mytable.name
> FROM mytable
> WHERE mytable.name LIKE 'S%'
> UNION
> SELECT yourtable.id, yourtable.name
> FROM yourtable
> WHERE yourtable.name LIKE 'S%';
>
> this is the result even if I don't specify ALL.
> id|name
> --+------
> 1|Smith
> 1|Soares
> 3|Soares

The second column is duplicate, but the first is not. It looks at all
columns to determine duplicates.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-03-30 16:17:17 Re: [DOCS] Reference Manual
Previous Message Jose' Soares Da Silva 1998-03-30 15:19:05 Reference Manual