删除列表中的id [英] delete where id in list

查看:170
本文介绍了删除列表中的id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个Ids列表(1,4,6,7)和一个db表,我想删除id在这个列表中的所有记录,这是最快的方式是什么?

if i have a list of Ids (1, 4,6,7) and a db table that i want to delete all records where id is in this list, what is the fastest way of doing this?

推荐答案

您的问题几乎将SQL描述为:

Your question almost spells the SQL for this:

DELETE FROM table WHERE id IN (1, 4, 6, 7)

这篇关于删除列表中的id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆