我想要mysql中if子句的简单示例.我不想考虑其他情况,只有if子句
最佳答案
例如:
SELECT *,if (`date_last` IS NULL,prev_date,last_date) as date
FROM `table_name`
WHERE `id` = 2
ORDER BY `date` DESC