P
P
Pavel Ivanov2017-10-20 08:35:57
PostgreSQL
Pavel Ivanov, 2017-10-20 08:35:57

How to properly execute DELETE?

There is a selection result in the form: (page_id, template_id). It is necessary to perform a delete operation for each result of the previous selection in the form: DELETE FROM table WHERE page_id = ? AND template_id = ?
How can this be done directly in SQL?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-10-20
@eastywest

DELETE FROM table WHERE (page_id, template_id) IN (SELECT page_id, template_id FROM table WHERE ....)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question