How does mysql realize the transfer of batch data to arrays?
Requirements Analysis:
As shown in the figure:
In the excel file shown in the figure above, the corresponding ad bits under each field are rendered as an array as shown in the following image lock:
Solution:
1. First, use mysql client Navicat for MySQL to import excel files in batches and build tables.
2. Then use the mysq function GROUP_CONCAT as follows:
Select 'country', country,GROUP_CONCAT (placementid) from 2019q2group by country union allselect' year', year,GROUP_CONCAT (placementid) from 2019q2group by year union allselect 'quarter', quarter,GROUP_CONCAT (placementid) from 2019q2group by quarter
These are the details of mysql converting a large amount of data into arrays, please pay attention to other related articles!