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. thinkphp6使用验证器 信息如何输出到前端页面2. boot2docker无法启动3. Android-Studio 新建项目 Missing styles4. php为什么是源程序显示?5. javascript - 我这个页面的main的盒模型为什么把header的模型空间也包括了。6. 老师,flex-shrink: 1; 按视频操作,不会自动缩放7. mac里的docker如何命令行开启呢?8. golang - 用IDE看docker源码时的小问题9. docker容器呢SSH为什么连不通呢?10. debian - docker依赖的aufs-tools源码哪里可以找到啊?

网公网安备