delete from ShouyeData where funcid = 10 and id not in(select t.id from (select id from ShouyeData where funcid = 10 limit 10) as t)
delete from ShouyeData where (select count(id) from ShouyeData where funcid=10)>10 and id not in(select b.id from ShouyeData b where funcid=10 order by id asc limit 10 ) 未测试,嘿嘿~~~
delete from ShouyeData where (select count(id) from ShouyeData where funcid=10)>10 and id not in(select b.id from ShouyeData b where funcid=10 order by id asc limit 10 ) 未测试,嘿嘿~~~ delete from ShouyeData where funcid=10 and (select count(id) from ShouyeData where funcid=10)>10 and id not in(select b.id from ShouyeData b where b.funcid=10 order by b.id asc limit 10) 楼主试试看,报错么。。
delete from ShouyeData where id not in (select id from ShouyeData where funcid=10 limit 10)
(select count(id) from ShouyeData where funcid=10)>10
and
id not in(select b.id from ShouyeData b where funcid=10 order by id asc limit 10 )
未测试,嘿嘿~~~
(select count(id) from ShouyeData where funcid=10)>10
and
id not in(select b.id from ShouyeData b where funcid=10 order by id asc limit 10 )
未测试,嘿嘿~~~
delete from ShouyeData where
funcid=10
and
(select count(id) from ShouyeData where funcid=10)>10
and
id not in(select b.id from ShouyeData b where b.funcid=10 order by b.id asc limit 10)
楼主试试看,报错么。。