SELECT A.OPRID, A.LOGIPADDRESS, TO_CHAR(CAST((A.LOGINDTTM) AS TIMESTAMP),'YYYY-MM-DD-HH24.MI.SS.FF'), ROUND((CAST(( CAST(SYSTIMESTAMP AS TIMESTAMP)) AS DATE) - CAST((TO_TIMESTAMP(TO_CHAR(CAST((A.LOGINDTTM) AS TIMESTAMP),'YYYY-MM-DD-HH24.MI.SS.FF'),'YYYY-MM-DD-HH24.MI.SS.FF')) AS DATE)) * 1440, 0)
FROM PSACCESSLOG A
WHERE ( A.LOGINDTTM = A.LOGOUTDTTM
AND A.PT_SIGNON_TYPE = '1'
AND A.LOGINDTTM >= SYSDATE - 1/24)
GROUP BY A.OPRID, A.LOGIPADDRESS, A.LOGINDTTM
ORDER BY 3 DESC
No comments:
Post a Comment