Hi,
I am trying to delete records from one table where they exist in another table. I am using the following syntax:
DELETE T1.* FROM T1
WHERE EXISTS (
SELECT T1.* FROM T1, T2 WHERE
T1.ID = T2.ID AND T2.DELETE='YES')
If I just run the select query then it returns the 1 record I want to delete from T1. However, when I run the above query it returns all the rows from T1.
Any Ideas?
I am trying to delete records from one table where they exist in another table. I am using the following syntax:
DELETE T1.* FROM T1
WHERE EXISTS (
SELECT T1.* FROM T1, T2 WHERE
T1.ID = T2.ID AND T2.DELETE='YES')
If I just run the select query then it returns the 1 record I want to delete from T1. However, when I run the above query it returns all the rows from T1.
Any Ideas?