当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
link_stat_a1_a3.sql 1.30 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 ('A1', 'A3')
#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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化