Thanks to other threads I've searched, from which I learned about Left outer joins, I have a query that identifies records to be deleted: those with default "Unknown" values in two fields in my "main" table, and no values (null) in a linked "issues" table.
Here is my sql:
SELECT t_wr_main.*, t_issue.issue_id
FROM t_wr_main LEFT JOIN t_issue ON t_wr_main.id = t_issue.id
WHERE (((t_wr_main.team)="Unknown") AND ((t_wr_main.unit)="Unknown") AND ((t_issue.issue_id) Is Null));
When I try and turn this into a delete query, however, to delete those records from t_wr_main that fulfill the criteria, I get the following message instead:
"could not delete from specified tables."
Here is the delete query sql:
DELETE t_wr_main.*, t_wr_main.team, t_wr_main.unit, t_issue.issue_id
FROM t_wr_main LEFT JOIN t_issue ON t_wr_main.id = t_issue.id
WHERE (((t_wr_main.team)="Unknown") AND ((t_wr_main.unit)="Unknown") AND ((t_issue.issue_id) Is Null));
What do I have wrong here, or is there an FAQ on deletes?
Here is my sql:
SELECT t_wr_main.*, t_issue.issue_id
FROM t_wr_main LEFT JOIN t_issue ON t_wr_main.id = t_issue.id
WHERE (((t_wr_main.team)="Unknown") AND ((t_wr_main.unit)="Unknown") AND ((t_issue.issue_id) Is Null));
When I try and turn this into a delete query, however, to delete those records from t_wr_main that fulfill the criteria, I get the following message instead:
"could not delete from specified tables."
Here is the delete query sql:
DELETE t_wr_main.*, t_wr_main.team, t_wr_main.unit, t_issue.issue_id
FROM t_wr_main LEFT JOIN t_issue ON t_wr_main.id = t_issue.id
WHERE (((t_wr_main.team)="Unknown") AND ((t_wr_main.unit)="Unknown") AND ((t_issue.issue_id) Is Null));
What do I have wrong here, or is there an FAQ on deletes?