YosiFZ
YosiFZ

Reputation: 7900

Sql delete multiple rows with multiple identifier

I'm trying to delete multiple row by two identifier:

DELETE FROM [Customers] 
WHERE (City,Country) IN (('Buenos Aires', 'Argentina'), ('Graz', 'Austria'))

And i'm getting this error:

Error 1: could not prepare statement (1 row value misused)

It's not possible to delete multiple rows with multiple identifiers?

Upvotes: 1

Views: 90

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1271141

If you database doesn't support tuples, just use explicit AND/OR logic:

DELETE FROM [Customers] 
WHERE (City = 'Buenos Aires' AND Country = 'Argentina') OR
      (City = 'Graz' AND Country = 'Austria');

Upvotes: 2

Related Questions