Deleting records from multiple tables

admin

Administrator
Staff member
I have four tables which include some bit of information about an account.

The tables are day,week,month,and accounts.

accounts.id = day.uid = week.uid = month.uid

I am trying to write a delete query which will remove all information about a user.

I tried even a basic delete statement such as:

delete from day,week where (day.id = week.id) and (day.id = '2200')

I can't seem to figure out a way to remove from multiple tables with one query. I am aware that I could write four separate delete queries, but that just seems silly. :)

thanks,

Matt
 
Back
Top