标题: 请问这样的SQL怎么写? [打印本页] 作者: fxn9801 时间: 2008-5-28 22:20 标题: 请问这样的SQL怎么写? 我是从SQL SERVER 数据库改成MYSQL数据库的。里面有些SQL语句语法有些小差异,我有个分页的SQL ,不知道怎么改成MYSQL 可以运行的语句?请大家帮忙?
语句是:
sql = "select top "+intpagesize+" * from article where fstatus=? and articleClass=? and articleId not in (select top "+((intpage-1)*intpagesize)+" articleId from article order by articleId desc) order by articleId desc";
如何改成在MYSQL下可以运行的语句呢?
我改成这样:
select * from article where fstatus=? and articleClass=? and articleId not in (select articleId from article order by articleId desc limit "+((intpage-1)*intpagesize)+") order by articleId desc limit "+intpagesize
报错:
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'