mysql关联删除

2023-04-12编程技术3752


<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后面必须指定表名

mysql关联删除的相关教程结束。

本文地址:https://www.ufcn.cn/tutorials/2453551.html

如非特殊说明,本站内容均来自于网友自主分享,概不代表本站观点,如有任何问题我们都将在收到反馈后的第一时间进行处理!