MySQL Forums
Forum List  »  General

Select Average of one group to compare with another
Posted by: Nick Franklin
Date: October 07, 2015 03:09AM

I have data in the form of
trans id Month
100 1 1
102 2 1
103 3 1
100 1 2
103 2 2
103 3 2
104 1 3
104 2 3
101 3 3

I would like to find the average for each Month for ID 1 and 2 and compare to ID 3 for the same month so ideally I want

Avgtrans id3Trans Month
101 103 1
101.5 103 2
104 101 3 etc

Options: ReplyQuote


Subject
Written By
Posted
Select Average of one group to compare with another
October 07, 2015 03:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.