当我从数据库重复数据中获取数据时,我有一些问题,但product_id和product_name应该是唯一的,而产品ID的数据显示在同一行中。
+-------------------+-------------+------------+----------------+-----------------+ | employee_id | product_id | product_name | secondary_sales | date | +-------------------+-------------+------------+----------------+-----------------+ | 8 | 3 | SENSI-TOUCH | 345 | 2015-09 | | 8 | 11 | MEDI-GRIP PF 8 | 1445 | 2015-07 | | 8 | 11 | MEDI-GRIP PF 8 | 267 | 2015-08 | | 8 | 11 | MEDI-GRIP PF 8 | 455 | 2015-10 | +-------------------+-------------+------------+----------------+-----------------+- 4 rows in set (0.71 sec)
我想接受这种类型的结果
product_id product_name sec_sales jul aug sep oct nov dec 3 SENISI-TOUCH 345 0 0 345
11 MEDI-GRIP 8 2167 1445 267 0 455 0 0