【发布时间】:2011-04-09 03:49:58
【问题描述】:
我有一个这样的选择查询
select count(distinct id)*100/totalcount as freq, count (distinct id) from
<few joins, conditions, gorup by here> .....
这会导致MySql 5.0下计算2次count吗?如果这是一个问题,我也可以计算我的应用程序中的频率。我知道Adding percentages to multiple counts in one SQL SELECT Query 中提出的解决方案,但我只是想避免嵌套查询
【问题讨论】:
标签: mysql optimization count