Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need to check and remove details
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...Received on Thu Jan 02 2003 - 13:45:14 CST
> 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
>
>