Subject | Re[2]: [ib-support] Delete where exists problem |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-03-20T14:02:16Z |
Alexander,
I don't understand why you have two references to tbl_service_rel. Wouldn't
delete from tbl_service_rel
where
exists(
select * from tbl_service svc
where tbl_service_rel.service_id = svc.service_id
and svc.party_id = 10700013277)
be what you want?
HTH,
Set
At 14:46 20.03.2003 +0200, you wrote:
I don't understand why you have two references to tbl_service_rel. Wouldn't
delete from tbl_service_rel
where
exists(
select * from tbl_service svc
where tbl_service_rel.service_id = svc.service_id
and svc.party_id = 10700013277)
be what you want?
HTH,
Set
At 14:46 20.03.2003 +0200, you wrote:
>Ok, it is quite simple
>
>There are 2 tables:
>
>tbl_service -> service_id, party_id, service_data
>tbl_service_rel -> service_id, relation_id, relation_data
>
>These are the real tables except that instead of "service_data" and
>"relation_data" there are some fields that are of no interest in this
>case i think
>
>The statement is:
>
>delete from tbl_service_rel
>where
> exists(
> select * from tbl_service_rel rel join tbl_service svc on
> (rel.service_id = svc.service_id)
> where svc.party_id = 10700013277)
>
>The select is OK it returns just what I want to. There are several
>rows for party_id - 10700013277 in tbl_service_rel