sql - Count number of records with same column -
having employees table following columns
eid ename salary did 100 king 5000 db 101 kochaar 7000 db 102 jack 6000 java 103 john 3000 java 104 marry 6000 db
the o/p iz in form
did count(eid) db 3 java 2 db 3 java 2 db 3
i tried using union all, i'm not sure, how achieve tiz o/p.
select did , count(*) on (partition did) yourtable
Comments
Post a Comment