当前位置: 代码迷 >> Sql Server >> top有关问题
  详细解决方案

top有关问题

热度:186   发布时间:2016-04-27 21:48:59.0
top问题
select   top   10   id   from   (   select   *   from   aa_tb   order   by   birthday   desc   )   as   a   where   id   not   in   (select   top   0   id   from   aa_tb)  

提示“除非同时指定了   TOP,否则   ORDER   BY   子句在视图、内嵌函数、派生表和子查询中无效。”

------解决方案--------------------
select top 10 id from aa_tb a where id not in (select top 0 id from aa_tb order by birthday desc ) order by birthday desc
  相关解决方案