| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Jay Blanchard | Date: | May 9 2002 3:12pm |
| Subject: | RE: Multiple tables in delete statement on Mysql 3 | ||
| View as plain text | |||
[snip] if i say: delete from tablename where tablename.id = someothertable.id; mysql complains because there is no reference to someothertable; error: Unknown table 'someothertable' in where clause. So how can I reference both tables without deleting from both tables? > >DELETE FROM tablename WHERE table1.id = table2.id > [/snip] You can try (i haven't tested this) the following, but I don't think it's going to work; DELETE table1.columnname FROM table1, table2 WHERE table1.id = table2.id You would have to cycle through all of the columnnames if it worked. Jay
| Thread | ||
|---|---|---|
| • Multiple tables in delete statement on Mysql 3 | Augey Mikus | 9 May |
| • RE: Multiple tables in delete statement on Mysql 3 | Jay Blanchard | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Augey Mikus | 9 May |
| • RE: Multiple tables in delete statement on Mysql 3 | Jay Blanchard | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Gelu Gogancea | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Augey Mikus | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Egor Egorov | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Paul DuBois | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Augey Mikus | 9 May |
| • Re: Multiple tables in delete statement on Mysql 3 | Paul DuBois | 9 May |
| • MySQL GROUP BY Anomaly? | Jay Blanchard | 9 May |
| • RE: MySQL GROUP BY Anomaly? | Max Anderson | 9 May |
| • RE: MySQL GROUP BY Anomaly? | Jay Blanchard | 9 May |
| • RE: MySQL GROUP BY Anomaly? SOLVED | Jay Blanchard | 9 May |
| • RE: MySQL GROUP BY Anomaly? | Max Anderson | 9 May |
