Mysql syntax — select Top3
$topThree = "SELECT score.groupID, SUM(cd + doc + tech + func) AS 總分
FROM score
GROUP BY score.groupID LIMIT 3;";
$name = "SELECT score.groupID, IOS110.project_name
FROM score
INNER JOIN IOS110 ON score.groupID = IOS110.groupID;";
$topThreeWithProjectNameSQL = "SELECT IOS110.project_name, score.groupID,
SUM(score.cd + score.doc + score.tech + score.func) AS 總分
FROM score, IOS110
WHERE score.groupID = IOS110.groupID
GROUP BY score.groupID,IOS110.project_name LIMIT 3;";
Comments
Post a Comment