gpt4 book ai didi

mysql - 除以第二个查询

转载 作者:太空宇宙 更新时间:2023-11-03 10:59:54 27 4
gpt4 key购买 nike

我正在尝试先查询第二个,我该如何处理?

SELECT COUNT(*) AS Result
FROM pparsdb.application
INNER JOIN pparsdb.planning_scheme
ON application.planning_scheme = planning_scheme.ps_code
WHERE planning_scheme.markus_ra = 'GA'

SELECT Result / COUNT(*)
FROM pparsdb.planning_scheme
WHERE markus_ra = 'GA'

最佳答案

试试这个,

SELECT  COUNT(*) / crss.totalCount AS Result
FROM pparsdb.application
INNER JOIN pparsdb.planning_scheme
ON application.planning_scheme = planning_scheme.ps_code
CROSS JOIN
(
SELECT COUNT(*) totalCount
FROM pparsdb.planning_scheme
WHERE markus_ra = 'GA'
) crss
WHERE planning_scheme.markus_ra = 'GA'

关于mysql - 除以第二个查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16703674/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com