Hi,
I have a table containing the following format:
Create table testtable(dates date, day_identifier number);
The day_identifier column data contains the corresponding dates columns' day of week equivalent i.e.
to_char(dates, 'd')
The table contains following sample data:
Dates | Day_identifier |
---|
01-Oct-2013 | 3 |
02-Oct-2013 | 4 |
04-Oct-2013 | 6 |
06-Oct-2013 | 1 |
08-Oct-2013 | 3 |
09-Oct-2013 | 4 |
11-Oct-2013 | 6 |
18-Oct-2013 | 6 |
21-Oct-2013 | 2 |
23-Oct-2013 | 4 |
I am looking for a query that will group the above data based on the day_identifier column data into the following format:
01-Oct-2013 11-Oct-2013 1346
18-Oct-2013 23-Oct-2013 246
The above data if expanded i.e.
all dates between 01-Oct-2013 and 11-Oct-2013 and having day of week value in 1,3,4,6
and
all dates between 18-Oct-2013 and 23-Oct-2013 and having day of week value in 2,4,6
will give me the above table's resultset.
Please help me in resolving the issue.
Thanks.