Excel uses pivot tables to count the number of unique values

The sample data source format is as follows. Now we need to count the number of people with uid in each group:

By default when using a pivot table, you can only select "Count" to get the number of rows for each group, and the uid is not deduplicated;

Mysql column conversion group_concat function

The group_concat function in MySQL can combine the specified fields of the group into one row of content, which is more suitable for column conversion.

The complete syntax is as follows:

group_concat([DISTINCT] Field to be concatenated [Order BY ASC/DESC sorting field] [Separator 'separator'])

The default delimiter is comma

Example:

select id,group_concat(distinct name) from table group by id;  

It should be noted that there is a default limit on the length of the merged fields.


refer to:

Introduction to web chart display js library Highcharts/Highstock

Statistical charts with numerical information play an important role on Internet web pages. In addition to the basic function of displaying numbers, people now pay more and more attention to the beauty and interactivity of these charts. As a result, programmers are facing more and more serious challenges. The process that most people imagine using drawing software to generate pictures and then putting them on web pages is unrealistic.

Subscribe to data