A
Aleks
Hi,
I need to delete records from my database, I have 3 tables
Table 1 has:
Users
1> UserId
2> CaseId
Here I have no problem, because I am deleting the user, so I use Delete from
table1 where userid = 1, that will delete the user from the table, the
problem is in table # 2
Cases
1> Id
2> CaseId
Here I don't have the UserId, but I have the CaseId, which comes from table
1 and can be linked.
How can I delete all 'cases' in table 2 where cases.caseid = users.caseid in
table 1 and users.userid in table 1 = 1 ?
In other words how can I delete all cases from table 2 where user = 1 ?
Thanks in advance,
Aleks
I need to delete records from my database, I have 3 tables
Table 1 has:
Users
1> UserId
2> CaseId
Here I have no problem, because I am deleting the user, so I use Delete from
table1 where userid = 1, that will delete the user from the table, the
problem is in table # 2
Cases
1> Id
2> CaseId
Here I don't have the UserId, but I have the CaseId, which comes from table
1 and can be linked.
How can I delete all 'cases' in table 2 where cases.caseid = users.caseid in
table 1 and users.userid in table 1 = 1 ?
In other words how can I delete all cases from table 2 where user = 1 ?
Thanks in advance,
Aleks