I have the below table showing employee leave days between two dates
+--------------+-----------+-----------+
| EMPLOYEENAME | BEGINDATE | ENDDATE |
+--------------+-----------+-----------+
| John | 06/JUN/18 | 06/JUN/18 |
| Paul | 25/JUN/18 | 06/JUL/18 |
| Jill | 23/APR/18 | 10/AUG/17 |
| Mary | 01/MAR/18 | 20/JUN/18 |
| Mary | 21/JUN/18 | 31/OCT/18 |
+--------------+-----------+-----------+
Id like to know how many business leave days the employee has taken for a particular month, in this example JUN-18. I'm expecting to see the below result:
+--------------+--------+-------------+
| EMPLOYEENAME | MONTH | DAYS_ABSENT |
+--------------+--------+-------------+
| John | JUN-18 | 1 |
| Paul | JUN-18 | 5 |
| Jill | JUN-18 | 21 |
| Mary | JUN-18 | 21 |
+--------------+--------+-------------+
Prefer to use SQL/PLSQL but last resort can use Python to do this.