i have a table emp with records as follows:
empname highprtjobs
tsaliki h1
sasi h2
Srinivas h3
tsaliki h4
sasi h5
in this i wrote a select statement as follows:
select empname,count(highprtjobs)as noofhighprtjobs from testemp group by empname. i got the result as
empname noofhighprtjobs
sasi 2
srinivas 1
tsaliki 2
In this now i am trying to get the one which is having min noofhighprtjobs. So i wrote the above statement but it is throwing some error.So how do i get the empname whose noofhighprtjobs is minimum.
select empname,count(highprtjobs)as noofhighprtjobs from testemp group by empname
having min(count(highprtjobs))
empname highprtjobs
tsaliki h1
sasi h2
Srinivas h3
tsaliki h4
sasi h5
in this i wrote a select statement as follows:
select empname,count(highprtjobs)as noofhighprtjobs from testemp group by empname. i got the result as
empname noofhighprtjobs
sasi 2
srinivas 1
tsaliki 2
In this now i am trying to get the one which is having min noofhighprtjobs. So i wrote the above statement but it is throwing some error.So how do i get the empname whose noofhighprtjobs is minimum.
select empname,count(highprtjobs)as noofhighprtjobs from testemp group by empname
having min(count(highprtjobs))