<update id="assignPlural" >
update exam_task set teacherId=#{teacherId} where id in (
select id from (
select id , row_number() over (partition by answerId order by null) m from
( select id , answerId from exam_task where answerId in
(select id from exam_answer where questionId =#{questionId})
and
answerId not in
(select answerId from exam_task where teacherId=#{teacherId})
)
) where m=1
) where rownum <=#{assignNum}
</update>
mybatis+oracle 一条update方法一直报sql命令为结束错误,不知道怎么回事
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
夜宇er 2017-11-17 02:08关注update exam_task set teacherId=#{teacherId} where id in (
) where rownum <=#{assignNum}这是你的第一句和最后一句,两个where 具体看一下你语句的结构,调整一下,或者把后面的where去掉本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报