我有一个 sql 表,比如表格
name age
h 1
a 2
r 3
i 4
我想删除第一行和第三行。我想要某种形式的东西,
delete from tablename where name=h,r;
这是正确的语法吗?
我有一个 sql 表,比如表格
name age
h 1
a 2
r 3
i 4
我想删除第一行和第三行。我想要某种形式的东西,
delete from tablename where name=h,r;
这是正确的语法吗?
尝试:
DELETE FROM tablename WHERE name IN ('h', 'r')
尝试
delete from tablename where name='h' or name='r';
You may use or operator or in condition like
delete from tablename where name='h' or name='r';
delete from tablename where name in ('h', 'r');
您需要使用条件运算符,例如`OR,
DELETE FROM tablename
WHERE name = 'h' OR name ='r'
您可以使用 or 运算符或在类似的条件下使用
delete from tablename where name='h' or name='r';
或者
delete from tablename where name in ('h', 'r');