sql server isnull function nor working count

Solutions on MaxInterview for sql server isnull function nor working count by the best coders in the world

showing results for - "sql server isnull function nor working count"
Elif
25 Apr 2016
1SELECT  FirstName, 
2        LastName,
3        IsNull((
4            SELECT  COUNT(UP1.EmailAddress) AS HasEmail 
5            From    dbo.UserProfiles AS UP1 
6            WHERE   (NOT (UP1.EmailAddress IS NULL)) 
7                    AND (CreatedBy = dbo.UserProfiles.UserID)
8            GROUP BY CreatedBy), 0) AS EmailEnteredCount 
9FROM    dbo.UserProfiles 
10WHERE   (IsStaff = 1)
similar questions