title: SQL check if a value exists in a query result
body: <p>The following query returns all releaseID that have only the territoryid =200 </p>
  
  <pre><code>select rt.ReleaseId from ReleaseTerritory rt 
  group by rt.ReleaseId
  having SUM(case when rt.TerritoryId=200 then 0 else 1 end)=0 
  </code></pre>
  
  <p>How can i do to check if the value <strong>47033</strong> exists or not in the resuls of the query above.
  Many thanks.</p>