oracle 查询语句转换成mysql语句
"SELECT*FROM"+"(SELECTdeptno,dname,loc,ROWNUMrnFROMdeptWHERE"+"(deptnoLIKE?ORdnameLIK...
"SELECT * FROM "
+ "(SELECT deptno,dname,loc,ROWNUM rn FROM dept WHERE "
+ " (deptno LIKE ? OR dname LIKE ? OR loc LIKE ?) "
+ " AND ROWNUM<=" + (currentPage * lineSize) + ") temp"
+ " WHERE rn>" + (currentPage - 1) * lineSize;
我不会oracle语句,求大家帮忙转换一下! 展开
+ "(SELECT deptno,dname,loc,ROWNUM rn FROM dept WHERE "
+ " (deptno LIKE ? OR dname LIKE ? OR loc LIKE ?) "
+ " AND ROWNUM<=" + (currentPage * lineSize) + ") temp"
+ " WHERE rn>" + (currentPage - 1) * lineSize;
我不会oracle语句,求大家帮忙转换一下! 展开
2个回答
展开全部
oracle用的rownum分页 mysql用的limit分页
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
直接拿进去运行
select deptno,dname,loc from dept where deptno like ? or dname like ? or loc like ? limit (currentPage - 1) * lineSize,currentPage * lineSize;
select deptno,dname,loc from dept where deptno like ? or dname like ? or loc like ? limit (currentPage - 1) * lineSize,currentPage * lineSize;
追问
这句我之前试过啦,虽然也是MYSQL的分页查询,但是好像不能和上面那句完全替换,程序不能实现它之前的功能!
追答
select deptno,dname,loc from dept where deptno like ? or dname like ? or loc like ? limit (currentPage - 1) * lineSize,lineSize;
之前写错了...
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询