Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: table union question
Hi.
Try following :
INSERT INTO foo_bar_table
SELECT * FROM foo_table
WHERE key_col = ( SELECT MIN(key_col) FROM foo_table ) UNION SELECT * FROM bar_table WHERE key_col = ( SELECT MIN(key_col) FROM bar_table )
HTH. Michael
In article <37F4F0CF.7C5BF516_at_hotmail.com>,
Jay <mighty_dragon_at_hotmail.com> wrote:
> Hello,
>
> Suppose I have three tables which are identical (in terms of columns,
> i.e.. they all have column key and column val).
>
> foo_table
> a 1
> a 2
> a 3
> b 1
> b 2
> b 3
>
> bar_table
> x 1
> x 2
> x 3
> z 1
> z 2
> z 3
>
> What would be the sql statement to produce the ff.
>
> foo_bar_table
> b 1
> b 2
> b 3
> x 1
> x 2
> x 3
>
> Thanks in advance for any help.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sat Oct 02 1999 - 01:16:30 CDT