i want a simple example of if clause in mysql. i don't want to consider else case,only if clause
+1
A:
ex:
SELECT *,
if (`date_last` IS NULL,prev_date,last_date) as date
FROM `table_name`
WHERE `id` = 2
ORDER BY `date` DESC
gsoni
2010-07-20 16:17:15