MYSQL:
select * from (select * from (select * from category order by cat_id  limit   20   ) as A order by cat_id Desc  limit   10) as B order by cat_id
大家能帮我解释下吗?
下面这种写法运行时不正确
"select * from users where userId not in(select userId from users limit 0,"+pageSize*(pageNow-1)+")limit 0,"+pageSize+""谢谢大家的帮助

解决方案 »

  1.   

    你把变量赋值然后考到mysql里运行一下,看看能否运行!!!
      

  2.   

    select top pageSize * from 表名 where userId not in (select top pageSize*(pageNow-1) * from 表名 )
    n代表每页的数量
    pagen也就是页数减去一,代表先排除前n*(页数-1)条,然后再此基础上top n 代表查到n条为止,这样就很好的控制了每页的数量,pagen这个变量很关键
      

  3.   

    最好加个order by xxx asc..
      

  4.   

    MySQL 不能用 top 關鍵字