我创建了以下查询,它从 3 个不同的表中提取数据:
SELECT
product_searchables_names.class_name AS Class_Name,
product_searchables_names.label AS Attribute_Label,
jss_products.extrafield102 AS Attribute1,
jss_products.extrafield103 AS Attribute2,
jss_products.extrafield104 AS Attribute3,
jss_products.extrafield105 AS Attribute4,
jss_products.extrafield106 AS Attribute5,
jss_products.extrafield107 AS Attribute6
FROM
product_searchables_categories
JOIN product_searchables_names ON product_searchables_categories.searchableID = product_searchables_names.ID
JOIN jss_products ON product_searchables_categories.categoryID = jss_products.categories
WHERE
jss_products.productID = '134890'
ORDER BY
product_searchables_categories.searchable_order ASC
它以以下格式输出数据
但我需要这种格式,其中第 1 行从 'Attribute'1 中选择值,从 'Attribute2' 中选择第 2 行等:
我该怎么做?
提前致谢