June 8, 2004 at 9:21 am
Hi all. I need to do the following:
delete from sysuser_webpage suwp, webpage wp
where suwp.sysuser_id = '2'
and suwp.webpage_uuid = wp.webpage_uuid
and wp.state_code IN ('CT', 'NH')
Obviously the first line tosses a syntax error. Can anyone explain how I can accomplish the above query? I'm just deleting from the sysuser_webpage table, but need comparison conditionals met which are in webpage table. Any thoughts? Thanks in advance!
June 8, 2004 at 10:19 am
Try this:
delete sysuser_webpage
where sysuser_id = '2'
and webpage_uuid in(
select webpage_uuid
from webpage
where state_code in('CT','NH'))
/rockmoose
You must unlearn what You have learnt
June 8, 2004 at 10:29 am
Ahh sweet mother of meat. Works great, thanks moose!
June 9, 2004 at 6:57 am
Or this way
delete suwp
from sysuser_webpage suwp
inner join webpage wp
on wp.webpage_uuid = suwp.webpage_uuid
and wp.state_code IN ('CT', 'NH')
where suwp.sysuser_id = '2'
sometimes joins run better than using IN depending on volume etc.
Far away is close at hand in the images of elsewhere.
Anon.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply