我需要一次性计算转换率,我可以获得计算的总计数值,以便用户在网站上取得全部成功:
SELECT COUNT(*) AS TotalSuccess FROM Orders Where Success like 'OK'
用户的全部内容可以找到:
SELECT COUNT(*) AS TotalTrialMade FROM productTrials
我如何能够成功地完成对话率,一次性使用sql,任何想法或帮助都将受到赞赏 感谢
答案 0 :(得分:2)
SELECT TotalSuccess/TotalTrialMade AS ConversionRate FROM
(SELECT COUNT(*) AS TotalSuccess FROM Orders Where Success like 'OK') AS SuccessCount,
(SELECT COUNT(*) AS TotalTrialMade FROM productTrials) AS TrialCount