title: replace null values in sql pivot
body: <p>I have the following query :</p>
  
  <pre><code>SELECT *
  FROM Table1
  PIVOT
  (
    SUM(Value)
    FOR [Period] IN ([06/1/2007],[07/1/2007])
  )
  AS p
  </code></pre>
  
  <p>Some of the rows returned are null but i want to replace them with 0.</p>
  
  <p>I've tried <code>SUM(ISNULL(Value,0)) as Val</code> but it's not working. ( it's saying incorrect syntax)</p>