SQL Server has a well known and widely used ISNULL function that actually replaces a null column value or null subquery value with whatever you specify. For example, if you were to write
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
SELECT ISNULL(UnitPrice,0)
FROM InventoryItem
1SELECT ISNULL(UnitPrice,0)
2FROM InventoryItem
then you would have zeros returned in your result set for all InventoryItem table records that had a NULL value for the UnitPrice field. Ever tried to do that in MySQL? It doesn't work because MySQL's ISNULL function simply returns a value telling you whether or not the argument to the ISNULL function was NULL or not. Not as cool when compared to SQL Server's nifty replace type of functionality now is it? But wait, no need to talk smack about MySQL - for there is another great and easy to use command in MySQL that will give us the same result!
[More]