下面这句更新语句报错啊
update PrUserRequire r set r.top=(1+(select max(top) from (select rr.top from PrUserRequire rr where rr.userId=?2) temp)) where r.id=?1 and r.userId=?2用的Spring JPA,实现用的Hibernate,数据库是MYSQL。使用时是这样的:
@Modifying
@Query("update PrUserRequire r set r.top=(1+(select max(top) from (select rr.top from PrUserRequire rr where rr.userId=?2) temp)) where r.id=?1 and r.userId=?2")
public void top(int id, String userId,);现在一启动就报错,有没有高手知道错在哪儿了?改写成sql执行是正常的啊。