title: Dropping duplicates in SQL based on column condition
body: <p>I have the table like so in SQL Server</p>
  <pre><code>ID  Type  StoreID IsPopular
  101 Book  22      1
  101 Book  22      0
  102 Cup   67      1
  102 Cup   67      0
  109 Phone 88      0
  </code></pre>
  <p>How can I get the resulting table where I only need where IsPopular is 1 if there are duplicates for the ID?</p>
  <pre><code>ID  Type  StoreID IsPopular
  101 Book  22      1
  102 Cup   67      1
  109 Phone 88      0
  </code></pre>