Answer the question
In order to leave comments, you need to log in
How to make a selection of table records by condition for values from a linked table?
Good afternoon. Let's say there are 2 tables, one-to-many or many-to-many relationship. How to make a selection to delete or change values in the main table, using the conditions for the filter from the field of the dependent (other) table?
Answer the question
In order to leave comments, you need to log in
DELETE FROM table1
WHERE id IN (
SELECT t1.id
FROM table1 AS t1
INNER JOIN table2 AS t2
ON ...
WHERE ... )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question