PanzerKunst
Programmer
I have a table HABILIT, whose columns are the following: LOGIN_DATE (date), LOGIN (varchar2), ROLE (varchar2).
Each time a user logs into the web application, an INSERT query is done, inserting the LOGIN and ROLE (application role) of that user at SYSDATE.
Only 2 roles exist : A or B.
Now, what I need is another query, to retreive some stats about these logins.
I need a query which for each day, displays the number of logins of users of role A, and of those of role B, ordered by descending date.
The resultSet I'm looking for could look like this:
For a given day, it is very possible to have no login of role A, or B, or both A and B (i.e. no entry in the HABILIT table for that/these role(s) for that day).
I'm not a crack in SQL. If someone could give me this query, I would be very grateful to him.
Info: the DB server involved is Oracle 8.
Each time a user logs into the web application, an INSERT query is done, inserting the LOGIN and ROLE (application role) of that user at SYSDATE.
Only 2 roles exist : A or B.
Now, what I need is another query, to retreive some stats about these logins.
I need a query which for each day, displays the number of logins of users of role A, and of those of role B, ordered by descending date.
The resultSet I'm looking for could look like this:
Code:
DATE | NB_LOGINS_ROLE_A | NB_LOGINS_ROLE_B
-----------|------------------|-----------------
01/06/2005 | 65 | 45
31/05/2005 | 87 | 128
30/05/2005 | 111 | 0
For a given day, it is very possible to have no login of role A, or B, or both A and B (i.e. no entry in the HABILIT table for that/these role(s) for that day).
I'm not a crack in SQL. If someone could give me this query, I would be very grateful to him.
Info: the DB server involved is Oracle 8.