MySQL降龙十八掌,第六掌内容:利涉大川之MySQL索引的使用与优化(附含MySQL8.0隐藏索引),了解详情>>
0

我的帖子

个人中心

设置

  发新话题
现在我写的更新查询语句可以执行,但是数据不会改变;语句如下;
UPDATE rk_loan_details
SET loan_sun_state = (SELECT loan_sun_state FROM(
SELECT concat("编号:",loan_id,"~",loan_water_number,"~",loan_project_number,"~",loan_unti,"~","借款",":",loan_money,"~","未核销",":",loan_surplus) FROM rk_loan_details ) AS k)
01.png (147.52 KB)

2018-6-27 02:23

01.png

02.png (93.66 KB)

2018-6-27 02:23

02.png

03.png (57.79 KB)

2018-6-27 02:23

表结构

03.png




执行
(SELECT loan_sun_state FROM(
SELECT concat("编号:",loan_id,"~",loan_water_number,"~",loan_project_number,"~",loan_unti,"~","借款",":",loan_money,"~","未核销",":",loan_surplus) FROM rk_loan_details ) AS k)

结果是什么?
对比一下;



(SELECT loan_sun_state FROM(
SELECT concat("编号:",loan_id,"~",loan_water_number,"~",loan_project_number,"~",loan_unti,"~","借款",":",loan_money,"~","未核销",":",loan_surplus) FROM rk_loan_details ) AS k)

这个出来的结果是什么?一条还是多条?



我的51CTO博客

SQL Server MCITP, MVP, MCT, DBA
‹‹ 上一贴:sql server 2008r2 备份数据库失败(维护计划)--其中备份 ...   |   下一贴:mssql case 条件匹配问题 ››
  发新话题
快速回复主题
关于我们 | 诚聘英才 | 联系我们 | 网站大事 | 友情链接 |意见反馈 | 网站地图
Copyright©2005-2018 51CTO.COM
本论坛言论纯属发布者个人意见,不代表51CTO网站立场!如有疑义,请与管理员联系:bbs@51cto.com