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. dockerfile - 为什么docker容器启动不了?2. web服务器 - ubuntu下布置apache加wsgi加python3. tp6 事务闭包操作问题4. 主从复制 - MySQL 主从延迟 300s 以上,求大神解答5. python打开.py文件的时候出现window无法打开该文件是怎么回事呢?6. javascript - sublime快键键问题7. css - 图片的宽度发生变化而高度却没有相应变?8. docker 17.03 怎么配置 registry mirror ?9. docker gitlab 如何git clone?10. javascript - 微信小程序 如何实现这种左滑动出现删除的办法?有相关api吗?

网公网安备