从一个表中删除两个记录

时间:2019-04-01 18:11:16

标签: sql

Delete from patient WHERE patientId='011' AND '022'

上面的sql语句可以从一个表中删除两个记录吗?

2 个答案:

答案 0 :(得分:1)

是的,但是您需要使用OR而不是AND

Delete from patient WHERE patientId='011' OR patientId = '022'

-- alternatively IN
Delete from patient WHERE patientId IN ('011', '022')

答案 1 :(得分:1)

您可以在此处使用:

Delete from patient WHERE patientId In ('011', '022')