sql="select  distinct table_A.aa,table_A.bb from table_A where aa in (select distinct top "+curPage*rowsPerPage+" table_A.aa from table_A left join table_B on table_A.aa=table_B.aa where isDel='1' order by bb desc) and aa not in (select distinct top "+(curPage-1)*rowsPerPage+" table_A.aa from table_A left join table_B on table_A.aa=table_B.aa where  isDel='1' order by bb desc) order by bb desc";不知道该句SQL语句哪里有问题???求助

解决方案 »

  1.   

    sql="select  distinct table_A.aa,table_A.bb from table_A where aa in (select distinct top "+curPage*rowsPerPage+" table_A.aa from table_A left join table_B on table_A.aa=table_B.aa where isDel='1' order by bb desc) and aa not in (select distinct top "+(curPage-1)*rowsPerPage+" table_A.aa from table_A left join table_B on table_A.aa=table_B.aa where  isDel='1') order by bb desc";这样行不行