Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Difficult SQL Please Help
On Sun, 20 Feb 2000 17:23:28 GMT,
"Sean Harasin" <sharasin_at_mbakercorp.com>
wrote in article <kqVr4.46$RE2.327756_at_dca1-nnrp1.news.digex.net>:
Here's a back-door self-modifying/self-writing-program approach. The "pure-programming-police" will probably yell and scream about about this, but it works, and *GREATLY* speeds up what would normally be a correlated query, because the
SET ECHO OFF; SET FEEDBACK OFF; SET HEADING OFF;
SET TERMOUT ON; SET TRIMOUT ON; SET TRIMSPOOL ON;
SELECT 'SELECT'; SELECT ' READING_DATE AS READ_DATE,'; SELECT ' MIN(reading_time) AS READ_TIME,';
-- Note the doubled single quotes;
SELECT ' SUM(DECODE(INSTRUMENT_NAME, ''P001'', (';
<Run whatever query it is that produces the result 3.92>
SELECT ' / ((DECODE(HEADWATER -';
SELECT ' TAILWATER, 0, NULL,(HEADWATER-TAILWATER))) / 100)))) AS "P001 DELTA_HEAD",';
...
etc, etc, for the rest of your code;
remember to double up single quotes
once you finish quoting the code...
SPOOL OFF;
@PART2
--
Walter Dnes <waltdnes@waltdnes.org> http://www.waltdnes.org
SpamDunk Project procmail spamfilters.
A picture is worth a thousand words; unfortunately,
it consumes the bandwidth of ten thousand words.
Received on Mon Feb 21 2000 - 23:53:27 CST
![]() |
![]() |