【问题标题】:How can i groupBy using multiple column name?我如何使用多个列名进行分组?
【发布时间】:2015-11-16 05:55:27
【问题描述】:

我有一个名为tags 的表。 Column 名称是 id,tag_name。 我想group by 使用tag_name

看起来像这样,

{ beauty,general-health,pregnency } as health.

什么是 sql 查询?

【问题讨论】:

    标签: sql group-by


    【解决方案1】:

    做一个子查询

       select...
        from (
        select { beauty,general-health,pregnency } as health
        from table) t
        group by health
    

    【讨论】:

      【解决方案2】:
      select * from tags  group by tag_name
      

      【讨论】:

        猜你喜欢
        • 2019-08-31
        • 2015-10-06
        • 1970-01-01
        • 2022-01-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多