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. java中关于直接插入排序遇到的问题。2. java - 如图,jsp页面的form中的action是怎么映射到这个位置的?为什么不写dynUser就可以映射到save?3. nignx - docker内nginx 80端口被占用4. javascript - 如何计算字符串宽度?5. javascript - npm run build后调用api返回index.html6. docker安装后出现Cannot connect to the Docker daemon.7. 计算机 - 我学习了C语言,数据结构和一点点java基础,想自学C++,请问买什么入门书籍好?8. docker绑定了nginx端口 外部访问不到9. docker不显示端口映射呢?10. docker start -a dockername 老是卡住,什么情况?
