Delete Query
-
Hi, I am having 2 table. I want to delete records having same ID within 1 query. e.g. ID name table1 1 a table2 1 b How can I do? Thanks
if you want to remove only from one table you can use this
DELETE FROM TABLE_1 WHERE ID IN (SELECT ID FROM TABLE_2)
or
DELETE FROM Table_1
FROM Table_2 AS t2 INNER JOIN
Table_1 as t1 ON t1.ID = t2.IDbut i don't know if it's possible to remove records from 2 different tables by one single query
I Wish the Life Had CTRL-Z Wizard's First Rule : People are fool,they believe what they want to believe or what they afraid to believe www.subaitech.blogspot.com
-
Hi, I am having 2 table. I want to delete records having same ID within 1 query. e.g. ID name table1 1 a table2 1 b How can I do? Thanks
It you have a relationship setup between the 2 tables on the id column with the cascading delete property set, then deleting the records for one table will delete the corresponding records from the other table
Declan Bright www.declanbright.com
-
Hi, I am having 2 table. I want to delete records having same ID within 1 query. e.g. ID name table1 1 a table2 1 b How can I do? Thanks