猿问

sql分页显示并排序

String sql="select top ("+pageSize+") * from userinfo where id"
 +" not in(select top (("+(pageIndex-1)+")*"+pageSize+") id from userinfo)";

 

 

我想分页同时根据id进行排序desc

哪位帮我改改!

当年话下
浏览 616回答 1
1回答

富国沪深

String sql="select top ("+pageSize+") * from userinfo where id" +" not in(select top "+(pageIndex-1)*pageSize+" id from userinfo order by id) order by id";
随时随地看视频慕课网APP

相关分类

SQL Server
我要回答