sql server如何查询指定行?

来源:互联网 发布:网站推广优化 编辑:程序博客网 时间:2024/06/03 19:07

转自:https://zhidao.baidu.com/question/84289452.html

select top 20 * from 表名 where id not in (select top 10 id from 表名)
///////////

select * from(
select
ROW_NUMBER()OVER(ORDER BY t.pk_id asc) as rowIndex,
t.*


FROM T_CORRECT_END t
INNER JOIN GET_CHILD_DEPT(579) a
on t.DEPT_PK=a.PK_ID


   where 
 
t.DR=0 and a.DR=0 and t.VSTATUS>=1
) t
where t.rowIndex>3
;




0 0
原创粉丝点击