Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete with intersect

Status
Not open for further replies.

specv

Programmer
Aug 8, 2001
42
CA
Hi,

Can we use intersect with delete command (or only with select) like :

delete addrid from emails
where emailhost = 'yahoo.com'
and
addrid in (select addrid from address where city
= 'Seattle')
intersect
delete addrid from emails
where emailhost = 'hotmail.com'
and
addrid in (select addrid from address
where city = 'Seattle');

Thanks.
 
Maybe I am misunderstanding, but couldn't you just write

delete addrid from emails
where emailhost in ('yahoo.com','hotmail.com')
and
addrid in (select addrid from address where city
= 'Seattle')
 
It is just an example, it's not a real problem, what i want to know is just if it is possible :

Delete
....
from ...
where ...
Intersect
Delete
....
from ...
where ...

thanks
 
A very easy way to check if it works is to try it on a set work tables.

 
In Oracle you can do this, also:
delete from (select * from emails where emails.addrid=address.addrid
and address.city = 'Seattle'
and emailhost in ('yahoo.com','hotmail.com'))

and the aswer to your question is NO!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top