What statement can I use to INSERT INTO tableA a new row ONLY IF a specific column in tableB equals some value, where tableB contains “itemid” and tableA includes “itemid” as well. I thought of INNER JOIN but is that possible somehow?
I also need exactly the same approach for DELETE.
It sounds like what you want is this:
If I understand your schema correctly, you can’t do an INNER JOIN, because tableA doesn’t have the matching row yet.
Now for the delete, you do have both row now, so you will do the join:
UPDATED based on OP’s comment to question and his own answer. This should allows a 1 to many releationship between Projects & Items.