mysql subquery does not support limit

 

mysql execute the following statement:

SELECT * FROM `xxx_base_info` where yn =1 and xxx_keeper_id in (SELECT id FROM `user`where level>1 and yn =1 order by level desc limit 50)

MySQL returned:

#1235 - This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'

solution:

1, add a layer of sub-queries get:

SELECT * FROM `xxx_base_info` where yn =and xxx_keeper_id in ( select aa.id from (SELECT id FROM `user`where level>and yn =order by level desc limit 50) aa)

Guess you like

Origin www.cnblogs.com/xuzhujack/p/11752968.html