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. node.js - vue怎么部署到网站里2. PHP类封装的插入数据,总是插入不成功,返回false;3. 求救一下,用新版的phpstudy,数据库过段时间会消失是什么情况?4. 跟着课件一模一样的操作使用tp6,出现了错误5. html按键开关如何提交我想需要的值到数据库6. angular.js - 百度支持_escaped_fragment_吗?7. javascript - 大神们,求救啊,搞百度编辑器,弄了三天了,问题,如下8. javascript - 微信小程序限制加载个数9. vue-resource获取不到本地json文件的数据?10. pdo 写入到数据库的内容为中文的时候写入乱码
