This is my user_agreements table:
|user_id|agreement_id|permitted | |-------|------------|-----------------------| |114983 |1 |2022-07-14 11:52:37.763| |114983 |2 |2022-07-14 12:18:42.100| |114999 |1 |2022-07-14 12:18:52.397| |115011 |1 |2022-07-18 22:39:22.360| |115011 |2 |2022-07-18 22:39:22.717| I want to delete this rows:
|user_id|agreement_id|permitted | |-------|------------|-----------------------| |115011 |1 |2022-07-18 22:39:22.360| |115011 |2 |2022-07-18 22:39:22.717| Tried with this:
DELETE FROM user_agreements WHERE (user_id, agreement_id) IN ((115011, 1), (115011, 2)) But I am getting an error:
SQL Error [4145] [S0001]: An expression of non-boolean type specified in a context where a condition is expected, near ','. Any ideas whats wrong there?
INwith multiple columns. That's simply not valid SQL syntax. You can use a table value constructor to create a "table" in the query itself and join with itINwith tuples in any form (equality, inequality, joins, subqueries, or literals). Oracle, DB2, PostgreSQL, MySQL, MariaDB do... just fyi.