MyBatis分页查询SQL Server2008时出现’@P0’ 附近有语法错误”
Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: ‘@P0’ 附近有语法错误。
错误如下:
org.springframework.jdbc.UncategorizedSQLException:
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: '@P0' 附近有语法错误。
### The error may exist in file [E:\Client\KaiXinHuYu\target\classes\cn\kx59\user\mapping\AccountsInfoMapper.xml]
### The error may involve cn.kx59.user.dao.AccountsInfoMapper.selectPageData-Inline
### The error occurred while setting parameters
### SQL: select top ? UserID, GameID, ProtectID, PasswordID, SpreaderID, Accounts, NickName, RegAccounts, UnderWrite, PassPortID, Compellation, LogonPass, InsurePass, FaceID, CustomID, Present, UserMedal, Experience, LoveLiness, UserRight, MasterRight, ServiceRight, MasterOrder, MemberOrder, MemberOverDate, MemberSwitchDate, CustomFaceVer, Gender, Nullity, NullityOverDate, StunDown, MoorMachine, IsAndroid, WebLogonTimes, GameLogonTimes, PlayTimeCount, OnLineTimeCount, LastLogonIP, LastLogonDate, LastLogonMobile, LastLogonMachine, RegisterIP, RegisterDate, RegisterMobile, RegisterMachine from AccountsInfo where UserID not in(select top ? UserID from AccountsInfo)
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: '@P0' 附近有语法错误。
; uncategorized SQLException for SQL []; SQL state [S0001]; error code [102]; '@P0' 附近有语法错误。; nested