Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help - Complex SQL SELECT statement!!!!

Re: Help - Complex SQL SELECT statement!!!!

From: Larry Jones <lljo_at_chevron.com>
Date: 1997/05/14
Message-ID: <3379C5F1.7ACF@chevron.com>#1/1

I am returning this data to a PowerBuilder datawindow, to put in to a VisualComponents Formula One spreadsheet. The data for the current year, and past two, need to go into separate columns of the spreadsheet, but all for the same well.

For example:

WELL	1994 bbls	1995 bbls	1996 bbls
0001	     3000	     9000	    14000
0002	    15000	    14000	     2000

Of course there is more to it than this example shows, but this is the real problem area. Trying to turn the rows of data, into columns of data.

Building a temporary table would be difficult (like this isn't!) but it may be an option. I was trying to avoid doing this, but I may not be able to. I am afraid that doing that may take too long, since this is being done in the reporting part of the application. But I guess I could fire off a trigger to create the table for the specified years, then build my datawindow on that table.

It may be something I will have to consider harder.

Graham Miller wrote:
>
> hello,
> You seem to have a really interesting problem.
>
> Even if you get this beast sorted out, long term maintenance is
> going to be less than fun.
>
> What are the circumstances that require you to have one query to give
> you the answer you want?
>
> Would it be possible to use a temporary table and and build the result
> set into that as either:
>
> 1) one row with updates
> or
> 2) multiple rows with separate processing when you use it to produce
> the final result.
>
> I promise that it will a lot more maintainable and flexible. It will
> probably run slower (this is not necessarily true).
>
> I am not criticising your approach, i have no idea of the
> circumstances that you have to produce an answer for.
>
> graham (aka grumpy).
>
> Graham Miller ...
> Opinions expressed are mine, they are free, and worth exactly what they cost.
Received on Wed May 14 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US