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
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Richard Jones
> Sent: Thursday, July 17, 2003 10:29 AM
> To: [EMAIL PROTECTED]
> Subject: [SQL] NOT and AND problem
>
>
> Dear All,
>
> I am having some confusion over a query wh
- 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
> f
Dear All,
I am having some confusion over a query which is supposed to achieve the
following: To remove a record from a table if the one or both of the
columns containing references to other tables no longer point to table rows
which still exist. There are good reasons why I cannot use foreign k