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 - Ajax返回json格式之后的数据解析后取出来的数据为undefined?2. css3 - 微信前端页面遇到的transition过渡动画的bug3. php - 微信开发验证服务器有效性4. python如何设置一个随着系统时间变化的动态变量?5. 个人主页博客统计中的“进入博客”不能点击6. Browser-sync安装失败问题7. sublime text 3不支持python的input吗8. javascript - jquery选择的dom元素如何更新?9. javascript - Webapp 关闭后重新打开无需登录如何操作?10. 网页爬虫 - 关于Python的编码与解码问题

网公网安备