Results 1 to 2 of 2
Jul 27, 2003, 18:32 #1
Can I "Relate" Tables in a DELETE Query?
Is there any reason why I can't do a query like the following...
DELETE FROM Stats, Domains WHERE Save='N' AND Flag='Y' AND DID=Domains.ID
(assume that "Save" and "DID" are fields in the Stats table and "Flag" is a field in the Domains table)
In other words, I only want to delete entries from the Stats table, but I need to use a field in the Domains table to qualify it. Will this work all right?
Jul 29, 2003, 12:50 #2
- Join Date
- Nov 2001
- Washington DC
- 0 Post(s)
- 0 Thread(s)
in mysql 4.0+ you can do multitable DELETEs (even to delete from a single table based on multiple table joins, as you need), but the format is a little different than you have here. See http://www.mysql.com/doc/en/DELETE.html for more info. I don't think it's possible to use joins in mysql 3.x but I could be wrong...(?)
--ViralA computer without Windows is like a chocolate cake without mustard.