|
我的user里面有两个set属性,role和station,当我要查包含role和station属性的user时出现错误如下
Caused by: java.sql.SQLException: ORA-00918: column ambiguously defined
看了sql语句,知道错误的原因,但是不知道怎么解决!
问题就出在as EmpID上!(有两个as EmpID)
我是用Criteria来查询的,没有sql和hsql的东西,所以不知道怎么更改别名,使其不冲突,哪位高人可以帮忙呀!!???
select * from ( select this_.id as id2_2_, this_.DelFlag as DelFlag2_2_, this_.EmpNm as EmpNm2_2_, this_.EmpNum as EmpNum2_2_, this_.LastUpdater as LastUpda5_2_2_, this_.LastUpdTm as LastUpdTm2_2_, this_.Mobile as Mobile2_2_, this_.Pswd as Pswd2_2_, this_.Remark as Remark2_2_, this_.Status as Status2_2_, role4_.EmpID as EmpID1, role2_.id as RoleID, role2_.id as id8_0_, role2_.Role as Role8_0_, station6_.EmpID as EmpID, station1_.id as StaID, station1_.id as id6_1_, station1_.DelFlag as DelFlag6_1_, station1_.StaCode as StaCode6_1_, station1_.StaNm as StaNm6_1_ from tblUser this_, tblUserRole role4_, tblRole role2_, tblUserStation station6_, tblStation station1_ where this_.id=role4_.EmpID and role4_.RoleID=role2_.id and this_.id=station6_.EmpID and station6_.StaID=station1_.id and station1_.id in (8, 9) and role2_.id in (1) and (1=1) and this_.DelFlag<>6 and this_.id<>2 order by this_.id asc ) where rownum <= 10 |
|