Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with a Delete Syntax

Status
Not open for further replies.

WizyWyg

Technical User
Jan 31, 2001
854
JP
I am trying to delete records from two different tables at one time.

In event I have eventid and eventname
in participants I have eventid and name

Table associates who will be attending events in table 1. So eventid = eventid in table 1 for how many people are attending.

What would be the delete syntax for Mysql, if I want to delete from table event eventid=1 and all those associated in the participants table where eventid=1

I know that these work:
DELETE FROM participants WHERE eventid=1
DELETE FROM event WHERE eventid=1

How can i combine the two?
 
Actually, it can't be done. I found a workaround.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top