I have an leave table with columns start_date and end_date. Employees
can apply leave for any date. Now i want to display the number of days
of leave he had taken in a year.. I want it to be displayed like this:-
Jan - 1
Feb - 10
Mar - 11
..
..
Dec - 12
Total - Whatever
Can you guys suggest me some way? Thanks in advance.
This query will work, but requires that you handle leaves that begins in
one month and ends in another by creating one record for each month.
This could create new problems because that means you can no longer sum
the number of leaves in a given period by simply counting the number of
records.