current position:Home>How to group the following data by film and television, education, music, E-sports and other sectors

How to group the following data by film and television, education, music, E-sports and other sectors

2022-02-03 00:13:27 CSDN Q & A

adopt sql Statement to filter out a set of data , How to group them again , Like this

The filtered data
Responsible party The frequency of
Yifang Education 826
Silent music 364
Mengbao Education 342
Changda E-sports 172
Guanlin Education 139
Daoran music 99
Huashu film and television 65
Tencent film and television 48
Haochuan children 42
Taojing music 40

Data you want , Let each of the same plates be next to , It's convenient to make a sunrise chart
Responsible party The frequency of
education Yifang Education 826
education Guanlin Education 139
education Mengbao Education 342
e-sports Changda E-sports 172
e-sports Dongguan E-sports 39
music Daoran music 99
music Taojing music 40
Movies Tencent film and television 48
Movies Mango video 37
Movies Huashu film and television 65




Refer to the answer 1:

The first column after conversion , Whether it is the last two Chinese characters of the responsible party field ?
If it is , You use it directly substr The function intercepts the last two Chinese characters as a column ;
If not , Is there another table recording the plate to which the responsible party belongs ?
If you have this form , Then it's good to associate two tables for query ;
Without this form , Then build a table like this




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202030013254140.html

Random recommended