Select count() max() Date HELP!!! mysql oracle

Posted by DAVID on Stack Overflow See other posts from Stack Overflow or by DAVID
Published on 2010-04-26T20:30:56Z Indexed on 2010/04/26 20:33 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

Hi guys i have a table with shifts history along with emp ids

im using this code to retrieve a list of employees and their total shifts by specifying the range to count from:

SELECT ope_id, count(ope_id)
FROM operator_shift
WHERE ope_shift_date >=to_date( '01-MAR-10','dd-mon-yy') and ope_shift_date
<= to_date('31-MAR-10','dd-mon-yy')
GROUP BY OPE_ID 

which gives

   OPE_ID      COUNT(OPE_ID)
     1            14
     2             7
     3             6
     4             6
     5             2
     6             5
     7             2
     8             1
     9             2
    10             4

10 rows selected.

NOW how do i choose the employee with the highest no of shifts under the specified range date, please this is really important

© Stack Overflow or respective owner

Related posts about time

Related posts about table