Search Postgresql Archives

Re: Question About UNION

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 9, 2008 at 1:48 PM, Bill Thoen <bthoen@xxxxxxxxxx> wrote:
> No, this won't work. Here's an example of my tables:
> Table1
> 1, 12, A
> 2, 16, B
> 8, 6, A
> 19, 9, C
>
> Table2
> 1, 13, D
> 2, 16, B
> 8, 6, B
> 12, 5, A

select * from table1
union
select table2.* from table2 left join table1 on table2.a=table1.a and
table2.b=table1.b where table2.a is null;

(Written in gmail, but you should get the basic idea.)

-- 
- David T. Wilson
david.t.wilson@xxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux