IFNULL(expression, alt_value)
mysql> select ifnull(ip,0) as ip from admin_users where id >1;+----+| ip |+----+| 0 || 0 |+----+2 rows in set