Home

Thursday, May 26, 2011

MySQL ISNULL

Table Sales_Data

store_name Sales
Store A 300
Store B NULL
The following SQL,
SELECT SUM(ISNULL(Sales,100)) FROM Sales_Data;
returns 400. This is because NULL has been replaced by 100 via the ISNULL function.

No comments:

Post a Comment

rathoddhirendra.blogspot.com-Google pagerank and Worth