我冒险超越了我的SQL Fu。我有三张表,列出了产品,说明和功能。每个产品有一个或两个描述,但每个产品有多个功能。这是我最新的查询,但不是我想要的。
SELECT
products.ID,
product_descriptions.short_description,
product_descriptions.language,
product_descriptions.subheading,
product_descriptions.web_name,
product_descriptions.description,
pf3.language,
pf3.feature
FROM
products
LEFT JOIN
product_descriptions ON product_descriptions.product_ID = products.ID
LEFT OUTER JOIN
(SELECT * FROM product_features GROUP BY product_ID) AS pf3 ON pf3.product_ID = products.ID
;
我想看起来像
的东西product1 - lang - description1
- lang - description2
- lang - feature1
- lang - feature2
product1 - lang - description1
- lang - feature1
- lang - feature2
- lang - feature3
或者,如果我也有
product1 - lang - description1
product1 - lang - description2
product1 - lang - feature1
product1 - lang - feature2
product2 - lang - description1
product2 - lang -feature1
感谢您寻找