Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OracleRdb and Oracle 7 SQL differences
Bob Nightingale wrote:
> John Tait wrote in message <35F4F49A.8EDADA08_at_ihug.co.nz>...
> >I am currently implementing a set of views which had been developed for
> >OracleRdb onto an Oracle 7 database, but have a problem with a syntax
> >which is allowed under OracleRdb but not Oracle 7 SQL.
> >
> >Under OracleRdb, the views make a lot of use of the following
> >(simplified) syntax
> >
> >select job.job, period.period,
> > (sum(cost.movement)
> > from costs cost
> > where cost.job = job.job
> > and cost.period >=1
> > and cost.period <= period.period)
> >from
> >jobs job,
> >periods period;
> >
>
> You are missing something here. For the Jobs table you have just the job
> field. For the Costs table you have specified (job,movement,period). For
> Periods table, you've only specified the period field. I would suggest as
> nested SQL statement to sum and filter movement. Is JOB the implied key
> field in each of the three tables?
>
> --Bob.
I don't think I have missed anything Bob - though I am not 100% sure as it is difficult when you try to simplify the example too much. In real life this is a tiny element of a much more complex view.
Basically I have a table of costs
job, period, cost_for_period
which I want to turn into a table of job, period, costs_year_to_date.
Jobs and Periods tables appear so that they can be fields in the resultant view - not all "Jobs" have "Costs". Periods is simply 12 rows (periods 1 to 12).
Thanks for the reply
JohnT Received on Mon Sep 21 1998 - 00:00:00 CDT