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

Home -> Community -> Usenet -> c.d.o.server -> Re: formatting the results

Re: formatting the results

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Wed, 16 Jun 2004 21:13:11 +0200
Message-ID: <40d09bd0$0$281$626a14ce@news.free.fr>

"Vince Laurent" <vincelaurent_at_sbcglobal.net> a écrit dans le message de news:s4guc0dnqc6kup45raa9sqkjutgf5u8t9p_at_4ax.com...
> I have a query which looks like this:
>
> SQL> select count(status) from v$session group by status;
>
> 15
> 623
>
> But I would like the output to look like this:
>
> 15 623
>
> And I would like to add
>
> SQL> select to_char(sysdate, 'HH24:MI') from dual;
>
> 13:35
>
> to the line as well. So I finally get something like:
>
> 13:35 15 623
>
> Ideas? Web sites/docs to check out?
> Thanks!
>

Maybe something like:

select to_char(sysdate, 'HH24:MI') curDate,

   sum(decode(status,'ACTIVE',1,0)) active,
   sum(decode(status,'INACTIVE',1,0)) inactive,
   sum(decode(status,'KILLED',1,0)) killed,
   sum(decode(status,'CACHED',1,0)) cached,
   sum(decode(status,'SNIPPED',1,0)) snipped
from v$session;
--
Regards
Michel Cadot
Received on Wed Jun 16 2004 - 14:13:11 CDT

Original text of this message

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