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. 网页爬虫 - python爬虫翻页问题,请问各位大神我这段代码怎样翻页,还有价格要登陆后才能看到,应该怎么解决2. javascript - jQuery post()方法,里面的请求串可以转换为GBK编码么?可以的话怎样转换?3. javascript - 一排三个框,各个框的间距是15px,距离外面的白框间距也是15px,这个css怎么写?4. html5 - javascript写业务有用到什么编程范式没?5. html5 - vue-cli 装好了 新建项目的好了,找不到项目是怎么回事?6. javascript - vue 数据更新了。但是dom没有更新,,,,,如图7. css3 - 微信前端页面遇到的transition过渡动画的bug8. javascript - vue 手机端项目在进入主页后 在进入子页面,直接按返回出现空白情况9. mysql - C#连接数据库时一直这一句出问题int i = cmd.ExecuteNonQuery();10. javascript - Vue 的依赖追踪属于单向数据绑定还是双向绑定?

网公网安备