clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335853 fiddles created (27448 in the last week).

CREATE TABLE Match ( Heim VARCHAR(50), Gast VARCHAR(50), HeimP NUMBER, GastP NUMBER );
 hidden batch(es)


INSERT INTO Match VALUES('Bayern München','Borussia Dortmund',1,1);
1 rows affected
 hidden batch(es)


INSERT INTO Match VALUES('Borussia Dortmund','Bayern München',0,3);
1 rows affected
 hidden batch(es)


INSERT INTO Match VALUES('Bayern München','Schalke',3,0);
1 rows affected
 hidden batch(es)


INSERT INTO Match VALUES('Schalke','Bayern München',0,3);
1 rows affected
 hidden batch(es)


SELECT SUM( CASE 'Bayern München' WHEN Heim THEN HeimP WHEN Gast THEN GastP END ) AS points FROM Match WHERE 'Bayern München' IN (Gast, Heim);
POINTS
10
 hidden batch(es)