Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从SQL表中删除多条记录_Sql - Fatal编程技术网

如何从SQL表中删除多条记录

如何从SQL表中删除多条记录,sql,Sql,我需要从SQL表中删除约600个计算机名。所有计算机都有唯一的名称。我知道我可以一个接一个地删除,但删除600台设备需要一些时间 问题是-我如何区分多个计算机名 要逐个删除,我使用了: select from [tablename] where HostName = 'computername' 你可以试试看 delete from [tablename] where hostname in ('name1', 'name2', ...);

我需要从SQL表中删除约600个计算机名。所有计算机都有唯一的名称。我知道我可以一个接一个地删除,但删除600台设备需要一些时间

问题是-我如何区分多个计算机名

要逐个删除,我使用了:

select from [tablename]
where HostName = 'computername'
你可以试试看

delete from [tablename]
 where hostname in ('name1', 'name2', ...);