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: SQL*PLUS select statment

Re: SQL*PLUS select statment

From: sunadmn <sunadmn_at_gmail.com>
Date: Thu, 07 Jun 2007 07:39:21 -0700
Message-ID: <1181227161.160090.115430@w5g2000hsg.googlegroups.com>


On Jun 7, 10:33 am, Maxim Demenko <mdeme..._at_gmail.com> wrote:
> sunadmnschrieb:
>
>
>
> > Ok here is the issue I have right now.
>
> > In the above select (first one) it appears to me that this is looking
> > at particulars with regards to the return data (numeric data) i.e.:
>
> > SELECT 6577 "COUNT",
> > 6146 GOOD_COUNT,
> > 91 FAIR_COUNT,
> > 340 UNACCEPTABLE_COUNT,
>
> > To me means select 6577,6146,91,340 from the corresponding. Because
> > this is dynamic data that changes every day/hour/minute these values
> > can't be hard coded. I did try to fool around (and I do mean "Fool")
> > with the query and modify it to the way I need it and I could not get
> > dynamic data back with that said how could I turn this into a dynamic
> > query that just pulls whatever data is in the data source to get a
> > dynamic set? Am I making any sense here? Am I just overlooking the
> > obvious?
>
> > Thanks,
> > -Steve
>
> Forget for a moment about WITH part of this query, assuming, your data
> is in the table EVERYDAY_SUMMARY,
> don't
>
> SELECT
> DECODE(RN,1,'COUNT',2,'GOOD_COUNT',3,'FAIR_COUNT',4,'UNACCEPTABLE_COUNT')
> COUNT_TYPE,
>
> DECODE(RN,1,"COUNT",2,GOOD_COUNT,3,FAIR_COUNT,4,UNACCEPTABLE_COUNT)
> COUNT_VALUE
> FROM EVERYDAY_SUMMARY, (SELECT ROWNUM RN FROM DUAL CONNECT BY LEVEL <= 4)
> WHERE PERIOD = TO_CHAR(SYSDATE - 1, 'YYYY-MM-DD')
>
> give you the results you are expected?
>
> Best regards
>
> Maxim

Exactly what I want. I just don't understand the portion of the WITH I guess was that doing something in a case like state? Received on Thu Jun 07 2007 - 09:39:21 CDT

Original text of this message

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