This discussion is archived
2 Replies Latest reply: Apr 7, 2012 6:58 PM by 850247 RSS

Better way to write this SQL?

918371 Newbie
Currently Being Moderated
select col1, count(*)
from TableA
group by col1
having count(*) =
(select max(vals)
from
(
select col1, count(*) as vals
from TableA
group by col1
having count(*) > 1
)
)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points