The reason Oracle is reading the query as recursive is because the Temp table name is Dates and the table name in the second select is also named Dates. Just rename the temp table something different (i.e. Dates1, etc.,). ;-)
YOUR CODE
Line 1: WITH Dates
...
Line 8: FROM Dates
....
Line 12: ... FROM Dates;
WORKING EXAMPLE
Line 1: WITH Dates1
...
Line 8: FROM Dates
....
Line 12: ... FROM Dates1;
I hope this was helpful!