MySQL Forums
Forum List  »  Newbie

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?

Options: ReplyQuote


Subject
Written By
Posted
what is wrong with this mysql query?
May 06, 2005 01:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.