0

I have the table like so in SQL Server

ID  Type  StoreID IsPopular
101 Book  22      1
101 Book  22      0
102 Cup   67      1
102 Cup   67      0
109 Phone 88      0

How can I get the resulting table where I only need where IsPopular is 1 if there are duplicates for the ID?

ID  Type  StoreID IsPopular
101 Book  22      1
102 Cup   67      1
109 Phone 88      0
Eisen
  • 1,697
  • 9
  • 27
  • 1
    It's unclear *which* of these it the right choice, but both follow the same methodology. – Thom A Nov 29 '21 at 16:34
  • IsPopular can be 1 or 0. If an ID has two rows each with 1 and 0, then I want to keep the one where IsPopular = 1. – Eisen Nov 29 '21 at 16:41

0 Answers0