EntityWrapper<UserBean> entityWrapper = new EntityWrapper<>();
userMapper.selectPage(new RowBounds(5, 5), entityWrapper);
报错信息
### Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “5”附近有语法错误。
### The error may exist in com/check/user/mapper/UserMapper.java (best guess)
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: SELECT id,phone,account,hashed,open_id AS openId,name,age,head_path AS headPath,role_id AS roleId FROM service_users OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: “5”附近有语法错误。
uncategorized SQLException for SQL []; SQL state [S0001]; error code [102]; “5”附近有语法错误。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: “5”附近有语法错误。] with root cause
当前使用版本(必须填写清楚,否则不予处理)
该问题是怎么引起的?
使用mapper的selectPage方法做分页
重现步骤
报错信息
后来发现是没有order by造成的,建议默认使用主键排序。