Handling recursive data

Hi all,

Assume that I have a table “Event” that has field “Previous Event”

Event 2001<—Event 2006<—Event 2008<— Event 2009

For each current event, I want to get a list of old events. For example, if I select Event 2008, it should display event 2001,2006 and 2008 in rows.
But if I select all events in 2005, it cannot display any result because “Event 2005” does not exist

The retrieve the total amount of income for all previous events, and total number of shows in the event.
The income of the event is recorded in table “Income”
The number of shows is recorded in table “event”

However, our current design is something like

Event<-----Recurrent Event
Event<-----Income
Event<-----Recurrent Income

i.e, there exist two “Income” inside our design, and also duplicate objects for current event and recurrent events

However, I suppose the system should be something like…

Root Event<----Event<----Income

which sounds more logical and do not need duplicate objects

How will you handle such the case? We use oracle and I think “connect by” may help. The most important objective is to allow users to select data easily.

Thanks


summoner :hong_kong: (BOB member since 2008-12-18)