Home » SQL & PL/SQL » SQL & PL/SQL » Sql statements -
Sql statements - [message #20147] Wed, 01 May 2002 13:09 Go to next message
prashant
Messages: 122
Registered: September 2000
Senior Member
delete from drv.mmh_location_derived_master
(select drv.location_id from
mmh_location_derived_master drv, mmh_location mmh
where ((drv.location_id = mmh.merchant_market_hierarchy_id(+))
and mmh.merchant_market_hierarchy_id is null))
/
what is wrong with this.. it doesn't work.. Thanks
Re: Sql statements - [message #20150 is a reply to message #20147] Wed, 01 May 2002 14:29 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I think you are looking to delete rows in drv where there is no corresponding row in mmh, right?

delete 
  from drv.mmh_location_derived_master drv
 where not exists (select null
                     from mmh_location mmh
                    where mmh.merchant_market_hierarchy_id = drv.location_id);
Previous Topic: ORA-00937: not a single-group group function
Next Topic: ALL Keyword
Goto Forum:
  


Current Time: Sat May 04 07:58:42 CDT 2024