Hello -
Can functions such as IF, ISNULL, IFNULL & DATE_FORMAT be used in the WHERE
clause of a query? I am getting syntax errors when trying this, the same
code works fine in the select part.
E.g.
select even.id
,even.event_name
,even.evca_id
,ifnull(evca.id,"null value")
,evca.description_en
from events even
left join event_categories evca
on even.evca_id = evca.id;
where (ifnull(evca.id,"X")) = 'X';
Returns:
mysql> where (ifnull(evca.id,"X")) = 'X';
ERROR 1064: You have an error in your SQL syntax near 'where
(ifnull(evca.id,"X")) = 'X'' at line 1
regards,
cynic n. 1. Someone further down the road than an idealist. Generally, past
the first blind curve. 2. One who persists in seeing the world as it is
rather than as it should be.