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

前端 未结 2 885
灰色年华
灰色年华 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:10

    You could start with this...

    SELECT number entity
         , 'pd_team'  attribute 
         , pd_team value
      FROM my_table
     UNION
    SELECT number
         , 'rating'  attribute 
         , rating value
      FROM my_table
     UNION ...
    

    Deriving the results from this would be trivial

提交回复
热议问题