mysql关联删除


<delete id="deleteBatchUserOfSp" parameterType="java.lang.String" >
delete from uauth.user
join uauth.usersp
on uauth.user.id = uauth.usersp.userid
where uauth.usersp.SPid = #{spid,jdbcType=VARCHAR}
</delete>
 

在做关联删除时这样的sql语句,mysql报错

 <delete id="deleteBatchUserOfSp" parameterType="java.lang.String" >
delete uauth.user from uauth.user
join uauth.usersp
on uauth.user.id = uauth.usersp.userid
where uauth.usersp.SPid = #{spid,jdbcType=VARCHAR}
</delete>

原来在delete后面必须指定表名

上一篇:indexOf 用法


下一篇:mysql 的存储引擎