title: group query result in which flag not included
body: <p>I have a table like this</p>
  
  <pre><code>NAME    FLAG
  ---------------------------
  abc     1
  abc     0
  abc     2
  def     1
  def     2
  xyz     0
  xyz     0
  xyz     1
  efg     1
  </code></pre>
  
  <p>I need query that list the name (group the result) which flag not included 0 and included 1.The result simply like below:-</p>
  
  <pre><code>NAME    FLAG
  ------------------
  def     1
  efg     1
  </code></pre>
  
  <p>I have tried the query but not results the same.</p>
  
  <pre><code>select * mytable where FLAG NOT IN (0) GROUP BY NAME;
  </code></pre>