View Full Version : Delete Query Inner Join


Sreedevi
12-20-2007, 10:11 PM
Hi,

I am very bad in queries and need your help on this one.

I am trying to run a simple delete query having an inner join but it gives an error every time. The error being
"Specify the table containing the records you want to delete"

here are the details of the simulated table and the query than I am trying to run

table1 :
name number
abc 1
xyz 2

table2
name city
abc A

Query that I am trying to run is:
Delete Table1 from Table1 INNER JOIN Table2 on Table1.name = Table2.name;

Thanks

Jon K
12-20-2007, 11:18 PM
Try this.

DELETE DISTINCTROW Table1.*
FROM Table1 INNER JOIN Table2 ON Table1.Name=Table2.Name;
.

Sreedevi
12-23-2007, 08:44 PM
Thanks Jon,

It worked, but just out of curiosity why does having a DISTINCTROW makes it working.


Thanks