Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I set up this select?
Ken Sproule wrote:
>
> Thanks for your help.
>
> Say I have 2 tables. One is a holding table with either new data to be
> inserted or updates to already existing data.
>
> tableA_data_to_put_into_TableB
> Name serial
>
> tableB_to_be_updated_or_inserted_into
> Name (PK_1) serial(PK_2)
>
> Notice that TableA has no constraints. Thus an attempt to insert into
> TableB if "serial" is duplicated will of course fail.
>
> My question is how to construct a select statement that will list all
> the records in tableA that have the same name and serial as in TableB
> --- but I don't know ahead of time the names or serials to put into
> the select's where clasuse.
>
> Can someone help me?
>
> Best,
>
> Ken Sproule
> kenmn_at_tds.net
How about:
SELECT name, serial FROM A INTERSECT SELECT name, serial FROM B;
--
Jerry Gitomer
Once I learned how to spell DBA, I became one
Received on Sun Apr 02 2000 - 22:27:00 CDT
![]() |
![]() |