Hi,
I'm trying to write an SQL query for my program, but I just can't figure out how. I don't know enough SQL.
I'm trying to implement an online team system (for some website). I have two tables:
teams | teamId, eventId
teammembers | teamId, userId, status
Now, I need to: "delete all records in teammembers
where the eventId for the corresponding teamId
is 1.
I'm trying:
delete from teammembers where teamId=teams.teamId and teams.eventId=1;
I'm not sure if this is really doing what I'm trying to do.
Please tell me if my query is wrong, and if it is (which probably is), please teach me how to write such a query.
Thanks!