Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with a query

Re: Need help with a query

From: x <tzadkiel_at_surfnetcity.com.au>
Date: 1998/03/29
Message-ID: <MPG.f88edd8574ce115989681@news.randori.com>#1/1

In article <6f9rft$otu_at_bgtnsc02.worldnet.att.net>, gennick_at_worldnet.att.net says...
> On Mon, 23 Mar 1998 16:19:09 -0600, dwarakv_at_hotmail.com
> wrote:
>
> > I have two tables A and B. I need to delete those records from table A
> >which match records in Table B. The description of the two tables are
> >
> > Table A Table B
> >I_id Number E_id Number
> >I_date Date E_date Date
>
> Assuming that ID and DATE are the keys, you could do
> something like this:
>
> delete from table_a
> where exists (
> select * from table_b
> where table_a.l_id = table_b.e_id
> and table_a.l_date = table_b.e_date
> )
>
> Jonathan
>
>

and even if they aren't the complete keys, you could just expand the where clause in the subselect to include all five matching fields.

share and enjoy.

tzad

-- 
"Uncle Tzad's House o' SQL"  -- soon to be a major motion picture.
Received on Sun Mar 29 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US