Hello,
Just to say thanks for such fast responses. The full working query is
indeed as suggested (I cut the demo query down when I posted it, as it's got
some awfully long names in it in real life):
DELETE FROM eulepersongroup2workspaceitem
WHERE NOT EXISTS (
SELECT 1 FROM workspaceitem WHERE w
CTED] Behalf Of
> [EMAIL PROTECTED]
> Sent: Thursday, July 17, 2003 10:29 AM
> To: 'Richard Jones'; [EMAIL PROTECTED]
> Subject: Re: [SQL] NOT and AND problem
>
>
> DELETE FROM myTable
> WHERE NOT (SELECT 1 FROM item WHERE myTable.item_id = item.item_id)
> AND NOT (SELE
I can't help you explain what is going on with this query - like you, I
am puzzled by the fact that it actually works, and have no idea how it
is interpreted, and what it is doing...
The right way to do what you want, I think, would be something like:
delete from mytable where not exists (select
DELETE FROM myTable
WHERE NOT (SELECT 1 FROM item WHERE myTable.item_id = item.item_id)
AND NOT (SELECT 1 FROM ep WHERE myTable.group_id = ep.group_id);
Terry Fielder
Manager Software Development and Deployment
Great Gulf Homes / Ashton Woods Homes
[EMAIL PROTECTED]
Fax: (416) 441-9085
> -O
- Original Message -
From: "Richard Jones" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 17, 2003 5:29 PM
Subject: [SQL] NOT and AND problem
> Dear All,
>
> I am having some confusion over a query which is supposed to achieve the
> following: To remove a record from a