我的下表显示了两个日期之间的员工休假天数
+--------------+-----------+-----------+
| 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 |
+--------------+-----------+-----------+
我想知道员工在特定月份(例如JUN-18)休了多少业务天。我希望看到以下结果:
+--------------+--------+-------------+
| EMPLOYEENAME | MONTH | DAYS_ABSENT |
+--------------+--------+-------------+
| John | JUN-18 | 1 |
| Paul | JUN-18 | 5 |
| Jill | JUN-18 | 21 |
| Mary | JUN-18 | 21 |
+--------------+--------+-------------+
首选使用SQL / PLSQL,但万不得已可以使用Python做到这一点。