shell - Update query wrong in MySQL
問題描述
各位大俠, 請(qǐng)問哪錯(cuò)了?
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
錯(cuò)誤
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:據(jù)我所知,then后面跟的應(yīng)該是個(gè)result,不知道是不是這么回事
相關(guān)文章:
1. css3 - 在sublime text里, 如何讓emmet生成的帶前綴css屬性垂直對(duì)齊?2. javascript - js 有什么優(yōu)雅的辦法實(shí)現(xiàn)在同時(shí)打開的兩個(gè)標(biāo)簽頁(yè)間相互通信?3. mac連接阿里云docker集群,已經(jīng)卡了2天了,求問?4. html5和Flash對(duì)抗是什么情況?5. javascript - 這是什么插件能把能把cli里面的webpack打包信息格式化?6. 想找個(gè)php大神仿個(gè)網(wǎng)站。7. javascript - 一個(gè)抽獎(jiǎng)的效果(如圖)?8. javascript - weex和node,js到底是怎樣一個(gè)關(guān)系呢?9. javascript - 怎樣限制同一個(gè)瀏覽器不能登錄兩個(gè)賬號(hào)10. javascript - jquery怎么給select option一個(gè)點(diǎn)擊時(shí)觸發(fā)的事件,如圖 如果選擇自定義觸發(fā)一個(gè)時(shí)間?
