select NV.PHG
From Nhanvien NV
Group by NV.phg
Having count(nv.Manv) >= all (select count(NV.MANV from nhanvien nv group by nv.MANV))
I'm finding a better way to find the 'max count' NV of a PHG ( in this example ) . I think, we meet this case all the time when we do SQL, i should've a better way . Thanks for reading this :)