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