I want to display V$SYSSTAT row values in columns. The current query:
---------------------------------------------------------------------
select  to_char(trunc(86400*(sysdate-to_date(
                '01/01/70','mm/dd/rr hh24:mi:ss')))),
        'stat38:stat39:stat40:stat41:stat44:stat105:'||
        'stat106:stat158:stat159:stat188:stat189:stat190',
        max(decode(se.statistic#, 38,se.value,0))||':'||
        max(decode(se.statistic#, 39,se.value,0))||':'||
        max(decode(se.statistic#, 40,se.value,0))||':'||
        max(decode(se.statistic#, 41,se.value,0))||':'||
        max(decode(se.statistic#, 44,se.value,0))||':'||
        max(decode(se.statistic#,105,se.value,0))||':'||
        max(decode(se.statistic#,106,se.value,0))||':'||
        max(decode(se.statistic#,158,se.value,0))||':'||
        max(decode(se.statistic#,159,se.value,0))||':'||
        max(decode(se.statistic#,188,se.value,0))||':'||
        max(decode(se.statistic#,189,se.value,0))||':'||
        max(decode(se.statistic#,190,se.value,0))
from    V$sysstat se
where   se.statistic# in(0,38,39,40,41,44,105,106,158,159,188,189,190)
group by to_char(trunc(86400*(sysdate-to_date(
                '01/01/70','mm/dd/rr hh24:mi:ss')))),
        'stat38:stat39:stat40:stat41:stat44:stat105:'||
        'stat106:stat158:stat159:stat188:stat189:stat190';
---------------------------------------------------------------------

Is there a better way to do this? 

This Best SQL Contest sponsored by...
Steve Orr,
Bozeman, MT
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Orr, Steve
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to