shell - Update query wrong in MySQL
PHPz
PHPz 2017-04-17 16:41:24
0
1
619

各位大侠, 请问哪错了?

Select * from rc where business_date = '2017-03-21 16:50:29.032'. IF
cutoff_dt` is null or empty, it will update, otherwise display not
null

  #!/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
PHPz
PHPz

学习是最好的投资!

全員に返信(1)
小葫芦

私の知る限り、その後に続くものは結果であるはずですが、それが当てはまるかどうかはわかりません

いいねを押す +0
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!