SELECT Product_type FROM product INNER JOIN product Product_type.typeid = product.pid
I have this sql query result list. This is exactly what i need.
--------------------------
Product_type | Product
--------------------------
ProductType 1 | Poduct A
ProductType 1 | Poduct B
ProductType 1 | Poduct C
ProductType 1 | Poduct D
ProductType 2 | Poduct E
ProductType 2 | Poduct F
ProductType 2 | Poduct G
--------------------------
现在,我的问题是如何根据产品类型获取产品列表。有什么办法用sql查询来获得这样的结果吗?如何安排SQL查询结果与列组?
我需要前端输出波纹管:
ProductType 1
| Product A
| Product B
| Product C
| Product D
ProductType 2
| Product E
| Product F
| Product G
或如何可以存储导致基于产品类型多dimational阵列。任何人都可以帮忙
大谢谢先进!
它是一种树结构,而不是表结构。 –
@ShaunakShukla,我只是想要所有的产品与project_type列出的目的安排。 –
我有SQL查询解决方案,我需要一个担心,从哪里获得产品列? –