Guest User

Untitled

a guest
Sep 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. select city, colour
  2. from t as t
  3. group by city, colour
  4. having count(*) = (select top (1) count(*)
  5. from t as t2
  6. where t2.city = t.city
  7. group by t2.colour
  8. order by count(*) desc, t2.colour
  9. );
Add Comment
Please, Sign In to add comment