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 to check and remove details

Re: Need to check and remove details

From: Niall Litchfield <niall.litchfield_at_dial.pipex.com>
Date: Thu, 2 Jan 2003 19:45:14 -0000
Message-ID: <3e1496c7$0$227$cc9e4d1f@news.dial.pipex.com>


look at the not exists clause. it sounds like this will do the job for you

eg something like

delete supplier s
where not exists (
select 1 from goods_supplied g
where g.supplier_id=s.supplier_id);

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************
"Jimbo" <threepio23_at_yahoo.com> wrote in message
news:av1a6i$s4a$1_at_venus.btinternet.com...

> In my database I want to produce some SQL code that checks my supplier
> records on an annual basis to find out if it HASN'T supplied anything to
the
> company. If it hasn't, I want it to remove the details of the supplier
from
> the company. I am wondering if anyone could tell me what type of code I
> would need to do this, or even better, some example of the code that could
> do this type of thing.
>
> Thanks
>
>
Received on Thu Jan 02 2003 - 13:45:14 CST

Original text of this message

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