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

【mysql错误】 This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'


 

SELECT * FROM duona_business_cash_ticket ct WHERE ct.id IN (  SELECT cr.id FROM duona_user_consume_record cr ORDER BY cr.createTime DESC LIMIT 3) LIMIT 3
 

 


解决方法:

SELECT * FROM duona_business_cash_ticket ct WHERE ct.id IN ( SELECT t.id FROM (SELECT cr.id FROM duona_user_consume_record cr ORDER BY cr.createTime DESC LIMIT 3) AS t ) LIMIT 3
 

 

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2012年12月18日 16:41:35 星期二



你可能感兴趣的:(mysql,MySQL子查询)