以下工作-退款等于1时返回Y,否则默认为N
IF(fd.charge_back = 1, 'Y', 'N') AS charge_back
但是我似乎无法使这一工作正常?语法有效吗
IF(compliment = ('set' OR 'Y' OR 1), 'Y', 'N') AS customer_compliment
最佳答案
大概这可以工作:
IF(compliment = 'set' OR compliment = 'Y' OR compliment = 1, 'Y', 'N') AS customer_compliment
关于mysql - mysql SELECT IF语句或,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9112029/