我有一个这样的产品表
+----------+------+-----------------+-------+-------+
| ParentID | SKU | Name | Price | Color |
+----------+------+-----------------+-------+-------+
| 1 | qwe | Product 1 Red | 12| Reb |
| 1 | qaz | Product 1 Blue | 13| Blue |
| 1 | erf | Product 1 Green | 11| Green |
| 2 | tgb | Product 2 Black | 12| Black |
| 2 | yhj | Product 2 White | 12| White |
| 3 | ujk | Product 3 Red | 15| Red |
| 3 | kjm | Product 3 Blue | 19| Blue |
| 3 | gfd | Product 3 Pink | 17| Pink |
| 3 | vgy | Product 3 White | 16| White |
| 3 | njk | Product 3 Black | 10| Black |
| 4 | cfg | Product 4 Red | 12| Red |
+----------+------+-----------------+-------+-------+
我想要的是一个查询,以获取每个包含所有项目信息的 parentid 的项目。我不在乎哪一行,但它应该包含该行的所有信息,并且每个 parentid 只有一个
我需要留下这样的东西
+----------+------+-----------------+-------+-------+
| ParentID | SKU | Name | Price | Color |
+----------+------+-----------------+-------+-------+
| 1 | qaz | Product 1 Blue | 13| Blue |
| 2 | yhj | Product 2 White | 12| White |
| 3 | gfd | Product 3 Pink | 17| Pink |
| 4 | cfg | Product 4 Red | 12| Red |
+----------+------+-----------------+-------+-------+