統計一段時間各個行業採購總數,總人數和審覈經過數量

SELECT
    category,
    COUNT(DISTINCT uid) AS sumUser,
    COUNT(id) AS purchaseCount,
    COUNT(
        IF (reviewStatus = 1, TRUE, NULL)
    ) AS reviewPassCount
FROM
    purchase_common pc
WHERE
    createTime >=?
AND createTime <=?
AND LENGTH(category) >= 6
GROUP BY
    categoryui

相關文章
相關標籤/搜索