最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

剔除前100条数据,根据主键ID排序

来源:http://erdangjiade.com/topic/79704.html 你好,世界。 2017-10-04 21:03浏览(0)

删除前100条数据,根据主键ID排序。
sql语句怎么写啊?
delete from visitrecord where id in (select top 100 from visitrecord order by id asc)

这样写有什么错误吗?
------解决方案--------------------
delete from visitrecord where id in (select id from visitrecord order by id asc limit 100)
------解决方案--------------------
delete from visitrecord limit 100

------解决方案--------------------
delete from visitrecord where id in (select id from visitrecord order by id asc limit 100)
------解决方案--------------------
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery

------解决方案--------------------
delete from visitrecord where id in (select top 100 from visitrecord order by id asc)
你的这个写法是sqlserver的

mysq写法如下
delete from visitrecord where id in (select id from visitrecord order by id asc limit 100);
------解决方案--------------------
都是大神啊,我轻飘飘的路过~~~

评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2