In MySql, if the first argument of an IF() function is a string, why does it return false?
SELECT IF('string', 'string', 'not string'); -- 'not string'
Of course I could sort of fix this if I did
IF(!ISNULL('string'), 'string', 'not string')) -- 'string'
or
IFNULL('string', 'not string'); -- 'string'
It seems somewhat counter-intuitive that it evaluates a string the way that it does seeing as
SELECT IF(1, 'one', 'not one'); -- 'one'
and
SELECT IF('1', 'one', 'not one'); -- 'one'
evaluate the way that they do...