📜  mysql 在一个查询中计算多列 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:02.244000             🧑  作者: Mango

代码示例1
mysql count multiple columns in one query:
 SELECT 
        count(*)             as count_rows,
        count(col1)          as count_1,
        count(col2)          as count_2,
        count(distinct col1) as count_distinct_1,
        count(distinct col2) as count_distinct_2,
        count(distinct col1, col2) as count_distinct_1_2
    FROM `table` ;