分页变量:
int now=2;//当前页
int pagesize=20;//每页显示条数
string where="cl5=2 and cl6 in(170,171,172) and cl7 like '%市场营销%'";//条件
以下拼sql语句:
select * from (
select top " + pagesize+ " * from (
select top " + (now * pagesize) + " * from (
select cl1,cl2,cl3,cl4,cl5,cl6,cl7,cl8 FROM table1 where "+where+"
) a order by a.cl1 desc
) b order by b.cl1 asc
)c order by c.cl1 desc
现在的问题就是sql占用cup资源灰常大,请各位高手帮忙提出对sql语句或数据结构等其它有效的解决方案