我想给分页的sql语句里加个条件进行排序怎么办
Stringsql="selecttop"+pageSize+"*fromBookswhereCategoryId="+typeId;sql+="andIdnotin(s...
String sql = "select top " + pageSize + " * from Books where CategoryId= " + typeId;
sql += "and Id not in(select top " + pageSize * (pageCount - 1) + " Id from Books with (index=PK_Book) where CategoryId=" + typeId + " )"; 展开
sql += "and Id not in(select top " + pageSize * (pageCount - 1) + " Id from Books with (index=PK_Book) where CategoryId=" + typeId + " )"; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询