Quote:
Originally Posted by markmcgary
Can you show your work, please? 
|
I haven't done SQL in decades. I just cobbled up an AWK script to read the match_teams table.
Code:
(ac=="red") && ($3=="red"){red+=$4; next}
(ac=="blue") && ($3=="blue"){blue+=$4; next}
(ac=="red") && ($3!="red"){
if(red>max){max=red; idmax=$1}
if(red<min){min=red; idmin=$1}
ac="blue"; blue=$4; next}
(ac=="blue") && ($3!="blue"){
if(blue>max){max=blue; idmax=$1}
if(blue<min){min=blue; idmin=$1}
ac="red"; red=$4; next}