Q: Count concurrent sessions per hours in a specified interval
786074Jul 19 2010 — edited Jul 22 2010Hi,
I have this table wich contains SESSIONID, CREATEDATE, LASTCHECKDATE, EXPIREDATE, PARTNERID
We need to make a query that would return the number of max concurent session per hours for the interval specified.
For example, for last week, on a per hour bases, or day bases, the top concurent session for each hour or day depending on the report.
can do the number of new session on each hour with this query;
SELECT TO_CHAR(createdate, 'YYYY/MM/DD HH24') ||'h ' start_time, COUNT( SESSIONID ) new_sessions, name || ' {' || partnerid || '}' as Partner
FROM uws
WHERE expiredate IS NOT NULL
and partnerid=25
and TO_CHAR(createdate,'YYYY/MM') = '2010/05'
group by TO_CHAR(createdate, 'YYYY/MM/DD HH24') ||'h ', name || ' {' || partnerid || '}'
ORDER BY 1 DESC;
I think I should use MAX(count(sessionid)) and probably some DECODE when c1 between createdate and lastcheckdate...
This would need to run on sqlplus from a shell script if possible and even chart it on Google Charts.
Any help appreciated, note that I am not an Oracle expert..
Edited by: user11954725 on Jul 19, 2010 5:55 PM