title: SQL Where to filter on Nested query
body: <p>I have a query that looks like this:</p>
  
  <pre><code>Insert Into tblX (a,b,c)
  Select x as a, y as b
     (select top 1 whatever from tblZ as z where z.aID  = y.aID order by z.s desc) as c
  from tblY as y
  where y.foo = 'bar'
  AND c &lt;&gt; NULL
  </code></pre>
  
  <p>The problem is that last line. 
  It tells me that c is an invalid column name. using y.c as well, to the same result.
  I need to not inset rows where that giant inner query is null, because tblX cannot accept nulls there. I feel like I should be able to filter on that column, but I can't quite get the syntax right. </p>