Hi,
I have the below query:
select distinct eventid, sum(tally) as numberofevents
from data_table
where eventid in
(
'516',
'517',
'531',
'533',
'535',
'516',
'517'
) and lastoccurrence >= '1012-12-19' and lastoccurrence < '2012-12-20'
group by eventid, tally
which returns data as in the below example:
eventid numberofevents
1024 15481
1026 2
1027 4
1031 57
I want my query to calculate a grand total for the number of events and display this in another column in the results, and i also wish to calculate a percentage for each eventid, showing its contribution towards the total.
Can anyone help/know how this would be done?
Many thanks :)