当前位置:数据库 > MySQL >>

struts2 的应用 数据库是Mysql 提示sql语句错误

PreparedStatement pstmt=conn.prepareStatement("select top "+pageSize+" (l.bookId,l.ISBN,b.bookName,b.publisher,b.price,l.ltime) from lend as l,book as b where readerId=? and b.ISBN=l.ISBN " + "and l.bookId not in (select top "+pageSize*(pageNow-1)+" l.bookId from lend as l)");
答案:下面的语句在我的SQL2005数据库中测试通过,你更改成你的表列和参数即可:

select top 2 I.username,J.password 
from Authority as I,SalePerson as J 
where I.password not in
(select top 1 password from Authority)

上一个:C#无法输入数据库MySQL
下一个:mysql 数据库

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,