Sql删除多个带有多个标识符的行

时间:2018-01-01 23:06:18

标签: c# sql database

我试图删除多行两个标识符:

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

我收到此错误:

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

无法删除多个标识符的多行?

1 个答案:

答案 0 :(得分:2)

如果您的数据库不支持元组,只需使用显式AND / OR逻辑:

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