日期:2014-05-17 浏览次数:20813 次
declare
n number;
pageNum number;
pageIndex number;
count1 number;
num1 number;
begin
pageNum:=10;
pageIndex:=1;
num1:= pageIndex*pageNum;
select count(*) into count1 from NBMM_USER_MSG where mType=''+1+'';
if(count1<num1)
then
n:=count1-((pageIndex-1)*pageNum);
else
n:=pageNum;
end if;
Execute Immediate 'select mid,mtype,m_mid,m_floor,muser,mmail,muserip,msg,muserimg,mdate,count1 as allcount from (select * from (select * from NBMM_USER_MSG where mType=''+1+'' and rownum<=num1 order by mDate desc) A where rownum<=n order by mDate asc ) B order by mDate desc';
end;