title: SQL - placing condition in where clause
body: <p>Earlier on today I asked this question at SO: <a href="https://stackoverflow.com/questions/4983544/count-and-left-join-problem">Count() and left join problem</a></p>
  
  <p>As indicated, the correct query for my problem is:</p>
  
  <pre><code>select s.name
         , p.name
         , count(p.id) 
  from   Shop as s
         left join Product as p on p.shop=s.id AND p.status &lt;&gt; '8796107276379'
  group by 
         s.id, p.name
  </code></pre>
  
  <p>We are using a proprietary framework which allows us to add restrictions to queries running on the system. I am quite sure that it is being achieved through a <code>where</code> clause being appended at the end of the queries. </p>
  
  <p>The problem is can I translate the above query in such a manner that <code>p.status &lt;&gt; '8796107276379'</code> is in a <code>where</code> clause so that I could add this as a restriction?</p>
  
  <p>The other answers at <a href="https://stackoverflow.com/questions/4983544/count-and-left-join-problem">Count() and left join problem</a> all put the condition in the <code>where</code> clause but none of them worked. </p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Krt_Malta</p>