what is wrong with this mysql query?
Posted by:
hal cal
Date: May 06, 2005 01:11AM
the following query is not working for me, and i can't figure out why. any ideas?
delete quiz,result,category,question,user_comments from quiz as q, result as
r, category as c, question as qs, user_comments as u where q.time<1110256723
and q.no_hits=0 and q.quiz_id=r.quiz_id and q.quiz_id=c.quiz_id and
q.quiz_id=qs.quiz_id and q.quiz_id=u.quiz_id
what i wanted the above query to accomplish is...
i have five tables quiz, result, category, question, user_comments
all have an identical field called 'quiz_id'
so i want to find all records in quiz where the 'time' field <1110256723 and the 'no_hits' field is = 0, and then delete all those records and any records in result, category, question, and user_comments tables that have the same 'quiz_id' value
anyone know what query would work for that?