Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: formatting the results
"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)) snippedfrom v$session;
-- Regards Michel CadotReceived on Wed Jun 16 2004 - 14:13:11 CDT