Home > Database > Mysql Tutorial > Mysql limit子查询语句_MySQL

Mysql limit子查询语句_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:38:11
Original
1026 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template