首页 > 数据库技术 > 详细

mysql关联删除

时间:2015-11-29 16:28:29      阅读:398      评论:0      收藏:0      [点我收藏+]

<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关联删除

原文:http://www.cnblogs.com/vinozly/p/5004831.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!