MySQL Forums
Forum List  »  Newbie

sub-query (INNER JOIN?)
Posted by: Harland Oracle
Date: September 10, 2020 08:35AM

I have a baseball batting table and I want to sum by year (yearID) and league (lgID) of atbats (AB), Walks (BB), and Strikeouts (KO)
Here's what I tried, but I get error
'group by yearID at line 4' error

select yearid, sum(AB), sum(BB), sum(SO)
from batting t1
where t1.lgid="AL"
inner join batting t2
on t1.yearid = t2.yearid
group by yearid;




dumb-founded at best

Options: ReplyQuote


Subject
Written By
Posted
sub-query (INNER JOIN?)
September 10, 2020 08:35AM
September 10, 2020 08:51AM
September 10, 2020 09:05AM
September 10, 2020 09:19AM
September 23, 2020 05:40AM


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.