I am really stuck at this this multiple condition queries.
There are 2 sets of sample data:
Here's What I want:
I want to know the students that been honorable mentioned by times, ie n=1, n=2, n=3 ... What is their average amount received in 2012 per price, per month, per different type of rewards, and return NULL if there's no value in a particular Month.
So far I have
SELECT Type_Of_Reward, Honorable_Mention, MONTH(date)
FROM Data_2 LEFT JOIN
SELECT(Honorable_Mention, COUNT(*) FROM Data_2 GROUP BY Honorable_Mention ON Student_ID = Honorable_Mention)
WHERE YEAR(Data_1.date)=2012 AND...
Any comments/helps would be greatly appreciated.