Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SYSTIMESTAMP not working

Orcl ApexMay 9 2018 — edited May 10 2018

Hi,

First query returns rows but not 2nd, please advise why it happened.

SELECT SUM (DECODE (session_state, 'ON CPU', 1, 0) ) oncpu

     , SUM (DECODE (session_state, 'WAITING', 1, 0) ) waiting

FROM v$active_session_history

WHERE sample_time >= SYSDATE - 3 / 24 / 60;

SELECT SUM (DECODE (session_state, 'ON CPU', 1, 0) ) oncpu

     , SUM (DECODE (session_state, 'WAITING', 1, 0) ) waiting

FROM v$active_session_history

WHERE sample_time >= systimestamp - INTERVAL '3' MINUTE;

This post has been answered by cormaco on May 10 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 7 2018
Added on May 9 2018
3 comments
887 views