T-SQL分组依据使用逻辑功能汇总字段

如何汇总并得出这些结果?

SELECT *
FROM TABLE
GROUB BY Column1 

enter image description here

评论
  • 文明人
    文明人 回复

    Assuming the columns actually contain the literal string values 'TRUE' and 'FALSE', we could use:

    SELECT
        Column1,
        MAX(Column2) AS Column2,
        MAX(Column3) AS Column3
    FROM yourTable
    GROUP BY
        Column1;