MYSQL
max κ° κ°μ§κ³ μλ μμ΄λ ꡬνκΈ°
π©· μ π§‘
2012. 11. 27. 16:34
728x90
SMALL
select max(aa.ν볡_count) max_ν볡, aa.ν λ§_id, aa.μ₯μ_id
from ν λ§λ³_μ₯μλ€ aa,
(
select μ₯μ_id from ν λ§λ³_μ₯μλ€
group by μ₯μ_id, ν λ§_id order by max(ν볡_count) desc
) bb
where aa.μ₯μ_id = bb.μ₯μ_id
group by aa.ν λ§_id
order by max(aa.ν볡_count) desc;
728x90
LIST