VVL1295

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

MySQL 子查询

  查询语句中嵌套的查询语句被称为子查询;

  注意点:from 子句里的子查询被称为派生表,需要加上别名;

  limit 子句不能加在 in 子句中的子查询中,即 select * from xxx where XX in (select * from xxx limit 2) 不合法,正确的做法 select * from xxx where XX in (select * from (select * from xxx limit 2))

  

posted on 2016-11-29 20:52  bobo2018  阅读(86)  评论(0)    收藏  举报