I am unable to remember this and have to find it each time I need it. In MSSQL there is a great function called ISNULL. It has two parameters. If the first one is NULL it takes the second one. In MySQL ISNULL takes only one parameter and checks whether it is NULL or not. The real replacement for MSSQL‘s ISNULL in MySQL is IFNULL.