i have two tables with type(type,playerid) and player(playerid,date) i have to find out for each year how many man of the match awards were won by which type of player ?
eg the table should be like
year type noofawards
2011 batsmen 3
2011 bowler 5
2010 batsmen 2
i can get the total number of awards won each year but cannot segregate them on type so what i get is
year noofawards
2011 3
select year , count(year) as "Number of awards"
from
(
select to_char(p.date,'YYYY') as year
from player p, type t
where p.playerid = t.playerid
)
group by year
order by year;
what should i do?