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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to use ISNULL to return "0" instead of NULL?

Author  Topic 

shawnmolloy
Yak Posting Veteran

93 Posts

Posted - 2008-09-23 : 04:41:11
As the title implies I want to return 0 when the column is null. I forgot how to implement the syntax:



-- Get Comment Count
LEFT JOIN
(SELECT VideoId, COUNT (*) AS CommentCount
FROM [Video_Comment]
GROUP BY videoId) Comment
ON Video.[VideoID] = Comment.[VideoId]



Thanks.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-23 : 04:50:23
use ISNULL(column,0)
Go to Top of Page

shawnmolloy
Yak Posting Veteran

93 Posts

Posted - 2008-09-23 : 05:44:34
Thank you Visakh!
Go to Top of Page
   

- Advertisement -