原来在oracle下执行没问题 现在每次到下面这句查询就Exception 我把语句拿到mysql中可以正常执行,请教各位?select distinct RESID from BASE_ROLE_RESOURCES where ROLEID='34';
07:49:40,750 DEBUG DebugLog:194 - Ajax调用处理后FormBean{rolename=4, msg=com.exp.dao.EXPSQLException: com.exp.dao.EXPSQLException:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ROLEID='34'' at line 1
07:49:40,750 DEBUG DebugLog:194 - Ajax调用处理后FormBean{rolename=4, msg=com.exp.dao.EXPSQLException: com.exp.dao.EXPSQLException:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where ROLEID='34'' at line 1
ROLEID 是int 还是varchar?是int型就这样子写
select distinct RESID from BASE_ROLE_RESOURCES where ROLEID=34;
select distinct RESID from BASE_ROLE_RESOURCES where ROLEID='34'; 你ID不是int么??是int的话 就 ROLEID=34
再一个就是说你ID不是唯一标识符? 既然指定了id=34 还要用distinct?