select b, count(b)
from A
group by b
order by count(b)
이렇게 하면 안되고
order by b
이렇게 하면 되는데 방법이...
b로 그룹바이를 해서 b의 카운트가 젤 높은것만 가져올려고 합니다.
답변부탁합니다.
having을 쓰세요.
아래와 같이 해보세요. select * from ( select b, count(b) cnt from ( select 'b' b from dual union all select 'b' from dual union all select 'a' from dual union all select 'c' from dual union all select 'a' from dual union all select 'b' from dual ) a group by b ) a order by a.cnt desc limit 1