title: Checking existence of a record in a SQL table using case statement
body: <p>The query below returns 'Found'  when the records with ID exists in services table but does not return 'Not Found'  when the record does not exists in the services table. I can't figure out why.</p>
  
  <pre><code>select case when  exists (select idaccount from services  where idaccount 
  =s.idaccount )
   then 'Found'
   else 'NotFound'  end as GSO  
   from services s 
   where s.idaccount in ( 1421)
  </code></pre>