title: Select distinct row based on 2 column values
body: <p>I have table like </p>
  
  <pre><code>PONO    LINESNO   status
  1        10        X
  1        20        X
  1        30        y 
  2        10        X
  2        20        X
  2        30        X
  </code></pre>
  
  <p>Here in this table we have 2 unique PO numbers 1 and 2 which having 2 <code>LINESNO</code> on each <code>PO</code> with separate status.
  I want to write a query to return only PO which all <code>LINESNO</code> have same status 
  e.g if I pass Status in Where clause  "<code>Where Status='X'</code>" 
  then it should return only one row  with PO 2 because <code>PO2</code> having all <code>LINESNO</code> same status with <code>X</code>  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;
        PO NO
      &lt;/td&gt;
      &lt;td&gt;
        LINENO
      &lt;/td&gt;
      &lt;td&gt; Status&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 1 &lt;/td&gt;
      &lt;td&gt; 10 &lt;/td&gt;
      &lt;td&gt; X&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 1 &lt;/td&gt;
      &lt;td&gt; 20 &lt;/td&gt;
      &lt;td&gt; X&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 1 &lt;/td&gt;
      &lt;td&gt; 30 &lt;/td&gt;
      &lt;td&gt; Y&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 2 &lt;/td&gt;
      &lt;td&gt; 10 &lt;/td&gt;
      &lt;td&gt; X&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 2 &lt;/td&gt;
      &lt;td&gt; 20 &lt;/td&gt;
      &lt;td&gt; X&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; 3 &lt;/td&gt;
      &lt;td&gt; 30 &lt;/td&gt;
      &lt;td&gt; X&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>