How we can merge same row with exact count using MySQL?

前端 未结 2 886
灰色年华
灰色年华 2021-01-27 20:40

I have output like this:

number      pd_team  rating         att_attorney      law_firm                  patent_developer
496486      Networks  Auto                      


        
2条回答
  •  渐次进展
    2021-01-27 21:18

    Try this query.

    select t1.name Value, count(t1.name) Count from(
        select pd_team from Table
        union all
        select rating from Table
        union all
        select att_attorney from Table
        union all
        select law_firm from Table
        union all
        select patent_developer from Table) t1 group by t1.name;
    

提交回复
热议问题