title: How to use coalesce with pivot
body: <p>Hello I'm trying to figure out to use coalesce with a Pivot so I can replace the NULLS with zeroes instead. Here is what I have: </p>
  
  <pre><code>     SELECT * FROM ( SELECT MovieTitle,AwardResultDesc, COALESCE(COUNT(p.AwardResultID),'0') AS T
       FROM tblMovie t1
              INNER JOIN tblAwardDetail p
                ON p.MovieID = t1.MovieID
              INNER JOIN tblAwardResult c
                ON c.AwardResultID = p.AwardResultID
      GROUP BY MovieTitle, AwardResultDesc,p.AwardResultID)
  
      PIVOT
      (
          max(T) FOR AwardResultDesc IN ('Won' AS "Won",'Nominated' AS "Nominated")
      ) 
      ORDER BY MovieTitle;
  </code></pre>
  
  <p>It seems like my Pivot is ignoring my coalesce for some reason, any suggestions?</p>