MySQL doesn‘t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery‘

经常写Oracle,MySQL写法有点差异
/*
select * from actionexecutelog where id not in (
SELECT id FROM actionexecutelog order by id desc limit 10)
*/–这会报错MySQL doesn’t yet support ‘LIMIT & IN/ALL/ANY/SOME subquery’

以下写法仅供参考
1:select * from actionexecutelog where id not in (
select t.id from (
SELECT id FROM actionexecutelog order by id desc limit 10) as t);

2:select * from actionexecutelog a ,(select id from actionexecutelog order by id desc limit 9,1) as b where a.id

你可能感兴趣的:(mysql)