shell - Update query wrong in MySQL
问题描述
各位大侠, 请问哪错了?
Select * from rc where business_date = ’2017-03-21 16:50:29.032’. IFcutoff_dt` is null or empty, it will update, otherwise display notnull
#!/bin/bash mysql -u root -pPassword <<rc use rc; SELECT *, CASE WHEN cutoff_dt IS NULL THEN UPDATE rc SET cutoff_dt = ’2017-03-21 00:00:00.0’ ELSE ’NOT NULL’ END from rc WHERE business_date = ’2017-03-21 16:50:29.032’; rc
错误
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’UPDATE rc SET cutoff_dt = ’2017-03-21 00:00:00.0’ ELSE ’ at line 5
问题解答
回答1:据我所知,then后面跟的应该是个result,不知道是不是这么回事
相关文章:
1. javascript - gitbook serve命令找不到fontsettings.js2. javascript - 如图,百度首页,查看源代码为什么什么都没有?3. node.js - nodejs+express+vue4. 如何创建一个可供自己输入的且数据类型固定的变量5. jquery - css3 scale 缩放图片问题6. javascript - Webpack 关于less依赖的问题7. Python获取HTTP请求的状态码(200,404等)8. 学html时,点“运行实例”点“提交”,右边的白框框没任何反应。9. 关于网站上传后浏览器不识别的问题10. vue.js - 项目提交到github上,怎么实现在线预览效果

网公网安备