Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> simple sql question/mlml
Hi All,
I have this 'newbie' sql question , i hope some has encountered. (im pretty sure someone knows the answer)
I have 2 tables.
'fiscalyear' defines fiscal periods with date ranges.
e.g.
How do i display each transaction row with these dates 'converted' to
their
fiscal periods?
my attempt is
select t.amt, d1.per, d2.per, d3.per, d4.per from
transactions t,
fiscalyear d1, fiscalyear d2, fiscalyear d3,
t.date1 between begin_date and end_date and t.date2 between begin_date and end_date and t.date3 between begin_date and end_date and t.date4 between begin_date and end_date ;
but this sounds very inefficient since its count a cartesion product with all the joins. (my report runs a very long time)
yr help is appreciated.
Mike
-- /-----------------------------------------------/ \--\--\ \-- \-- \-- / www.ncf.carleton.ca/~ae299 /---\ \ \ \\ \ \ / ae299_at_freenet.carleton.ca /-----\ \ \\-- \-- \-- /-----------------------------------------------/Received on Tue Oct 07 1997 - 00:00:00 CDT