Here is the output. No problem here. Exactly what I want. But I added the DISTINCT ID to remove duplicates and that works in each grouped month.
MN | CNT
====================
1 | 1
10 | 2
11 | 5
12 | 5
SELECT EXTRACT(MONTH FROM TRUNC(HDATE)) as MN, COUNT(DISTINCT ID) as CNT
FROM Schema.TRAVEL
WHERE (ARR = '2' OR ARR = '3')
AND
HDATE BETWEEN to_date('2015-10-01', 'yyyy-mm-dd') AND to_date('2016-09-30', 'yyyy-mm-dd')
GROUP BY EXTRACT(MONTH FROM TRUNC(HDATE));
But I can still possibly have duplicates that span more than each month. So if I have a record in October and another in November with the same ID - I want to only count this once - that is my issue
So over the course of a year or any time period - an ID only gets counted once...but I still need to maintain the monthly groupings and output...
??
idcount if there are multiple values over more than 1 month.