Hi all,
I have the following
CREATE TABLE adjustment (
id NUMBER(19, 0) NOT NULL,
startDate DATE,
interval INTEGER,
occurrence INTEGER,
PRIMARY KEY(id)
);
INSERT INTO adjustment VALUES(1, '2010-06-01', 4, 4);
INSERT INTO adjustment VALUES(2, '2010-06-01', 1, 12);
Basically it is a table for adjustment dates that are based on a start date, an interval in months and an occurrence.
What I am trying to achieve is a single query where the results contain the row id and each adjustment interval date. So running the query on the above will result in the following.
1, '2010-06-01'
1, '2010-10-01'
1, '2011-02-01'
1, '2011-06-01'
2, '2010-06-01'
2, '2010-07-01'
2, '2010-08-01'
2, '2010-09-01'
2, '2010-10-01'
... etc
I am fully aware that this is not the best data design in the world, but unfortunately that is out of my control.
I'm not entirely sure if this is possible, and if it is, how to go about it.
Any help would be much appreciated.
Thanks.