我尝试了以下查询,但执行时间太长: SELECT employees.company as x, COUNT(DISTINCT (results.employee_id)) "Total Surveys", (SELECT COUNT(employees.id) FROM employees WHERE company = x) "Headcount"JOIN employees
输出将有4列: Country、State、Year、Month、YTD Count of Users with purchase activity。 有没有办法做到这一点?当我从视图中排除月份并执行不同的计数时,以下代码可以正常工作: Select Year, Country, State,From MemberActivity
W
焦点放在最后3列 SELECT DISTINCT ui.DisplayName, COUNT((distinct case when uw.Title Is Not Null then uw.Title else null end) Assigned,
count(distinct case whenuw.Status Is Null then uw.Title else null end) Not