mybatis表关联查询
<selectid="selectByPrimaryKey"resultMap="ResultMapWithBLOBs"parameterType="java.lang....
<select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
,department.Department_Name
from specialty a JOIN department b
on a.Department_Id = b.Department_Id
WHERE b.Department_Id = a.Department_Id
AND a.Specialty_Id = #{specialtyId,jdbcType=INTEGER}
</select>
报错
Column 'Department_Id' in field list is ambiguous
???????????? 展开
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
,department.Department_Name
from specialty a JOIN department b
on a.Department_Id = b.Department_Id
WHERE b.Department_Id = a.Department_Id
AND a.Specialty_Id = #{specialtyId,jdbcType=INTEGER}
</select>
报错
Column 'Department_Id' in field list is ambiguous
???????????? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询