Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to handle null with max function

Author  Topic 

naresh0407
Starting Member

30 Posts

Posted - 2010-11-02 : 13:18:51
Hi,


How to handle null in max function

FOr example

max(empno) should handle null values.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-11-02 : 13:23:46
The only way a null will appear as a max or min is if the column only contains nulls.
Go to Top of Page

naresh0407
Starting Member

30 Posts

Posted - 2010-11-02 : 13:25:44
If the column contains null then it should return 0 instead of null.
How to do that.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-11-02 : 13:29:43
Answered in your other thread:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=152463
Go to Top of Page
   

- Advertisement -