Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

SUM function query

$
0
0
Hi guys!

Hi,

I am trying to solve the following exercise in order to practice my knowledge in sql. The exercise is located in: The JOIN operation - SQLZOO

and the one I am stuck with is number 13, could anybody help me out.
As far as I come out I have many different codes but all of them the editor complains is wrong.

I thought this was kind of on the right path but seems not to be at all
Code:

SELECT mdate,
  team1,
 count(CASE WHEN teamid=team1 THEN 1 ELSE 0 END) as score1
  FROM game JOIN goal ON matchid = id

thanks in advance!

Viewing all articles
Browse latest Browse all 13329

Trending Articles