I want to get some information from a database in wich there are events of certain dates that I want to count and group by the date for several users.
Until now I have made the query for counting and grouping one user.
SELECT
emp.first_name || ' ' || emp.last_name AS Employee_Name,
to_char(e.start_date_time,'MM/DD/YYYY') as DATE,
count(e.start_date_time) COUNT
FROM
event e,
alignment al,
employee emp,
customer c,
event_signature es
WHERE
e.start_date_time BETWEEN TO_DATE('8/13/2007','MM/DD/YYYY') AND TO_DATE ('8/24/2007 23:59:59','MM/DD/YYYY HH24:MI:SS')
AND e.alignment_id = al.alignment_id
AND e.employee_id = emp.employee_id
AND e.customer_id = c.customer_id
AND upper(e.event_type) = 'C'
AND signature_type(+) = 'DROP'
AND emp.employee_id = 160
AND e.event_id = es.event_id (+)
AND e.event_sub_type NOT LIKE 'NV'
GROUP BY
to_char(e.start_date_time,'MM/DD/YYYY'),
emp.first_name || ' ' || emp.last_name
What I get from this:
But I want to get them all users together in one table in separate columns.
For example:
Is this Posible?
And how can I make it to work?
Please help!!