I have read alot of other answers but cannot get this working!.
select * from invTypes
inner join invGroups on invtypes.groupID = invgroups.groupID
where invGroups.categoryID = 25;
I simply want to delete the record from invTypes if the category ID matches to 25
Would be very grateful of assistance
I have already tried:
delete from invTypes
inner join invGroups on invtypes.groupID = invgroups.groupID
where invGroups.categoryID = 25;
Gives error: near "inner": syntax error:
DELETE FROM invTypes
WHERE groupID in ( SELECT groupID FROM invGroups INNER JOIN invTypes ON (invGroups.groupID = invTypes.groupID)
WHERE invGroups.categoryID = 25);
Gives: ambiguous column name: groupID: DELETE FROM invTypes WHERE groupID in ( SELECT groupID FROM invGroups INNER JOIN invTypes ON (invGroups.categoryID = invTypes.categoryID) WHERE invGroups.categoryID = 25);