I have this query
users.username AS `user`
LEFT JOIN `users` ON articles.user_id = users.id
ORDER BY articles.timestamp
SELECT a.*, COALESCE(u.username, 'User Not Found') AS `user` FROM ARTICLES a LEFT JOIN USERS u ON u.id = a.user_id ORDER BY articles.timestamp
The reason to choose COALESCE over IF or IFNULL is that COALESCE is ANSI standard, while the other methods are not reliably implemented over other databases. I would use CASE before I'd look at IF because again - CASE is ANSI standard, making it easier to port the query to other databases.