SQLite condition

后端 未结 2 643
眼角桃花
眼角桃花 2021-01-25 17:50

I just want to convert this function query from navicat to sqlite query,

 Select * from tbl_sample where ID = 1 And IF (
        RECEIPT_MODE = \'MANUAL\',
              


        
2条回答
  •  一生所求
    2021-01-25 18:03

    The standard SQL mechanism for that IF would be a CASE expression:

    Select * from tbl_sample where ID = 1 And CASE
           WHEN RECEIPT_MODE = 'MANUAL'
           THEN DATE(a.MANUAL_COLLECTION_DATE) = DATE('2016-08-10 04:18:00')
           ELSE DATE(TPAY_ISSUED_DATE) = DATE('2016-08-10 04:18:00')
       END
    

提交回复
热议问题