码迷,mamicode.com
首页 > 数据库 > 详细

mysql关联删除

时间:2015-11-29 16:28:58      阅读:140      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!