select
ID,TITLE,CONTENT,USERNAME,REALNAME,UNIT,UNITID,NOWTIMES,ACCEPTERID,ACCEPTERNAME,KEYFIELD,ACCEPTDEPTID,ACCEPTDEPTNAME,IFFB
FROM (
select ROW_NUMBER() Over(order by NOWTIMES DESC ) as row_num,
ID,TITLE,CONTENT,USERNAME,REALNAME,UNIT,UNITID,NOWTIMES,ACCEPTERID,ACCEPTERNAME,KEYFIELD,ACCEPTDEPTID,ACCEPTDEPTNAME,SFFB
from OA_PT_COMPANYLEADER
where
USERNAME =‘f0c3c2aa-ebaf-458f-91cd-19d6dcd8e1a7‘
) where row_num between (1-1)*15+1 and (1-1)*15+15;
通用简单的 分页 SQL
原文:http://www.cnblogs.com/dullbaby/p/5212622.html