shell - Update query wrong in MySQL
問(wèn)題描述
各位大俠, 請(qǐng)問(wèn)哪錯(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
問(wèn)題解答
回答1:據(jù)我所知,then后面跟的應(yīng)該是個(gè)result,不知道是不是這么回事
相關(guān)文章:
1. javascript - 如何使用nodejs 將.html 文件轉(zhuǎn)化成canvas2. 如何解決docker宿主機(jī)無(wú)法訪(fǎng)問(wèn)容器中的服務(wù)?3. angular.js - 輸入郵箱地址之后, 如何使其自動(dòng)在末尾添加分號(hào)?4. javascript - Web微信聊天輸入框解決方案5. 在mac下出現(xiàn)了兩個(gè)docker環(huán)境6. javascript - 后臺(tái)管理系統(tǒng)左側(cè)折疊導(dǎo)航欄數(shù)據(jù)較多,怎么樣直接通過(guò)搜索去定位到具體某一個(gè)菜單項(xiàng)位置,并展開(kāi)當(dāng)前菜單7. java如何生成token?8. python - Scrapy存在內(nèi)存泄漏的問(wèn)題。9. CSS3 畫(huà)如下圖形10. angular.js - $stateChangeSuccess事件在狀態(tài)跳轉(zhuǎn)的時(shí)候不執(zhí)行?
