这些查询单独工作。如何将 UNION 写入 SUM 所有结果?
SELECT SUM(players) FROM `tournament_players` FROM (
SELECT COUNT(*) as `players` FROM `tournament_players` WHERE `foursome_1_p1_name` IS NOT NULL AND `tournament` BETWEEN 13 AND 17 AND flight = '8 AM'
UNION
SELECT COUNT(*) as `players` FROM `tournament_players` WHERE `foursome_1_p2_name` IS NOT NULL AND `tournament` BETWEEN 13 AND 17 AND flight = '8 AM'
UNION
SELECT COUNT(*) as `players` FROM `tournament_players` WHERE `foursome_1_p3_name` IS NOT NULL AND `tournament` BETWEEN 13 AND 17 AND flight = '8 AM'
UNION
SELECT COUNT(*) as `players` FROM `tournament_players` WHERE `foursome_1_p4_name` IS NOT NULL AND `tournament` BETWEEN 13 AND 17 AND flight = '8 AM'
)