当前位置:Gxlcms > mysql > Mysqllimit子查询语句_MySQL

Mysqllimit子查询语句_MySQL

时间:2021-07-01 10:21:17 帮助过:78人阅读

bitsCN.com


Mysql limit子查询语句

(1)mysql limit 不支持子查询像下面这条语句无法执行

SELECT * FROM b_c_s1 where CT_ID IN

(SELECT DISTINCT CT_ID FROM b_c_s1 LIMIT 0,2);

(2)应该在只查询外面再加一个查询

SELECT * FROM b_c_s1 where CT_ID IN (SELECT a.CT_ID FROM

(SELECT DISTINCT CT_ID FROM b_c_s1 LIMIT 0,2) a)

bitsCN.com

人气教程排行