MySQL's MIN
and MAX
functions are for aggregations only. This will not work and produce an error:
SELECT id, MIN(birthday, '1978-01-01') FROM users;
In order to compute the minimum or maximum value for the current row, use
LEAST
Show archive.org snapshot
and
GREATEST
Show archive.org snapshot
instead:
SELECT id, LEAST(birthday, '1978-01-01') FROM users;
Posted by Henning Koch to makandra dev (2011-03-07 16:32)