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

使用sql concat拼接更新语句

时间:2017-11-10 13:46:30      阅读:388      评论:0      收藏:0      [点我收藏+]

标签:source   select   eal   where   row   mobile   use   使用   order   

例子:

select a.id,concat(‘update sljr_jrxj.loan_borrow set status=3,fadada_status=0 where borrow_user_id=‘,a.id,‘ and borrow_nid=‘‘‘,borrow_nid,‘‘‘;‘)
from sljr_jrxj.user a
inner join sljr_jrxj.loan_borrow b on a.id=b.borrow_user_id
inner join sljr_jrxj.real_user c on a.id=c.user_id
where
b.`status`=0 and b.fadada_status=0 and
b.order_source=‘39‘ and
a.mobile in
(
‘18993037575‘)

使用sql concat拼接更新语句

标签:source   select   eal   where   row   mobile   use   使用   order   

原文地址:http://www.cnblogs.com/hy87/p/7813917.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!