mysql SELECT IF statement with OR

后端 未结 2 1182
一生所求
一生所求 2020-12-10 00:39

The following works - returns Y when chargeback equal to 1 else it defaults to N

IF(fd.charge_back = 1, \'Y\', \'N\') AS charge_back

howeve

相关标签:
2条回答
  • 2020-12-10 00:58
    IF(compliment IN('set','Y',1), 'Y', 'N') AS customer_compliment
    

    Will do the job as Buttle Butkus suggested.

    0 讨论(0)
  • 2020-12-10 01:09

    Presumably this would work:

    IF(compliment = 'set' OR compliment = 'Y' OR compliment = 1, 'Y', 'N') AS customer_compliment
    
    0 讨论(0)
提交回复
热议问题