I'm doing query
in oracle 11g
and they ask me to select the last 3 dates when a client paid invoice. The query I have it like this:
SELECT
t1.datefield date_1,
t1.datefield date_2,
t1.datefield date_3
FROM
table t1
WHERE
t1.datefield BETWEEN TO_DATE('01/07/2016', 'dd/mm/yyyy')
AND TO_DATE('31/07/2016', 'dd/mm/yyyy');
I need that month_1 be from July 1 to July 31, month_2 from August 1 to August 31 and month_3 from September 1 to September 30 ...
How can I solve that doubt?