如何划分嵌套查询的两个结果?我的意思是:我有一个存储过程
SELECT s.sheep_id,
( s.sheepThatHadBirth / ( s.sheepThatHadBirth + s1.sheepThatNotHadBirth ) ) * 100
FROM (SELECT sheep_id,
Count(*) AS sheepThatHadBirth
FROM FemaleSheep_Has_Wave
WHERE pregnencies_succeded = 1
GROUP BY sheep_id)AS s
CROSS JOIN (SELECT sheep_id,
Count(*) AS sheepThatNotHadBirth
FROM FemaleSheep_Has_Wave
WHERE pregnencies_succeded = 0
GROUP BY sheep_id)AS s1
结果不正确,因为交叉加入我想请帮助谢谢