作者:郝蕾雅老_206 | 来源:互联网 | 2014-06-09 00:50
Mysqllimit子查询语句(1)mysqllimit不支持子查询像下面这条语句无法执行www.2cto.comSELECT*FROMb_c_s1whereCT_IDIN(SELECTDISTINCTCT_IDFROMb_c_s1LIMIT0,2);(2)应该在只...Synt
Mysql limit子查询语句
(1)
mysql limit 不支持子查询像下面这条语句无法执行
www.2cto.com
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)