jin_zzz
千尺梦
2017-11-17 01:57
采纳率: 100%
浏览 1.7k
已采纳

mybatis+oracle 一条update方法一直报sql命令为结束错误,不知道怎么回事

<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 &lt;=#{assignNum} 
</update>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • qq_39813070
    夜宇er 2017-11-17 02:08
    已采纳

    update exam_task set teacherId=#{teacherId} where id in (
    ) where rownum <=#{assignNum}

    这是你的第一句和最后一句,两个where
    
    具体看一下你语句的结构,调整一下,或者把后面的where去掉
    
    点赞 评论
  • Kuroro_Lucifer
    Kuroro_Lucifer 2017-11-17 01:59

    where rownum &lt ; =#{assignNum} 有个分号,结束了,后面还有sql语句

    点赞 评论

相关推荐