Mysql Simple Query 23.06.08
this should be a 2 second job for a experience mysql programmer ..
my problem is, i have 2 tables one is called “user” another is called “mail_msg”, which related through a “user_id” foreign key
what i did was i deleted some of the users from the user table, now i wanted to delete all the msg that are in that “mail_msg” table by these users.
i guess i have to use delete and join and “NULL” but still couldn’t figure out how. here are table fields
for user : user_id, user_name …. etc
for mail_msg: id, user_id, user_from, user_to, …etc
(this user_id and user_to are equal) this means user_id is the one who is receiving the msg to the other person who is “user_from” .
i want to delete all mail messages that “user_from” have been deleted in the user table,
any ideas ???



