当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 54

fisher / foot
关闭

forked from aoe5188 / foot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
link_stat_c1_c2.sql 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
monomania 提交于 2020-03-15 15:48 . 1.增加统计排列sql
SELECT
*
FROM
(SELECT
ar.`AlFlag` AS 'flag',
DATE_FORMAT(ar.`MatchDate`, '%w') AS 'week',
ar.`LetBall` AS 'letball',
COUNT(1) AS 'total',
SUM(IF (ar.`Result` = "命中", 1, 0)) AS 'right',
SUM(IF (ar.`Result` = "错误", 1, 0)) AS 'error',
SUM(IF (ar.`Result` = "走盘", 1, 0)) AS 'none',
SUM(
IF (
mh.`MainTeamGoals` > mh.`GuestTeamGoals`,
1,
0
)
) AS '3',
SUM(
IF (
mh.`MainTeamGoals` = mh.`GuestTeamGoals`,
1,
0
)
) AS '1',
SUM(
IF (
mh.`MainTeamGoals` < mh.`GuestTeamGoals`,
1,
0
)
) AS '0'
FROM
foot.`t_analy_result` ar,
foot.`t_match_his` mh,
foot.`t_league` l
WHERE ar.`MatchId` = mh.`Id`
AND mh.`LeagueId` = l.`Id`
AND ar.`TOVoidDesc` = ''
AND ar.`Result` != "待定"
AND ar.`AlFlag` IN ('C1', 'C2')
#AND DATE_FORMAT(ar.`MatchDate`, '%w') = 0
GROUP BY ar.`AlFlag`,
DATE_FORMAT(ar.`MatchDate`, '%w'),
ar.`LetBall`
ORDER BY ar.`AlFlag`,
DATE_FORMAT(ar.`MatchDate`, '%w'),
ar.`LetBall`) t
WHERE t.total > 10
AND (
t.error / t.total >= 0.8
OR t.right / t.total >= 0.8
OR t.none / t.total >= 0.8
OR t.1/t.total > 0.5
) ORDER BY t.week ASC
Go
1
https://gitee.com/fisher2048/foot.git
git@gitee.com:fisher2048/foot.git
fisher2048
foot
foot
master

搜索帮助