Friday, February 24, 2012

Join question

SQL 7.0
How do I do this in Transact SQL? Is this a join issue?
If the record in B has a flag = 0, then that record
should be deleted from A?
Thx,
Don
Something like this perhaps:
DELETE FROM A
WHERE EXISTS
(SELECT *
FROM B
WHERE flag = 0
AND B.key_col = A.key_col)
David Portas
SQL Server MVP
|||Perfect!
Thank you very much,
Don

>--Original Message--
>Something like this perhaps:
>DELETE FROM A
> WHERE EXISTS
> (SELECT *
> FROM B
> WHERE flag = 0
> AND B.key_col = A.key_col)
>--
>David Portas
>SQL Server MVP
>--
>
>.
>

No comments:

Post a Comment