SELECT
a.*,
b.attr_value,
c.attr_value
FROM
(
SELECT
t1.id AS "skuid",
t1.jindie_code AS "金蝶",
t1.boke_code AS "博科",
t2.`name` AS 'name',
substr( substring_index( t1.attr_str, "-", 2 ), 2 ) AS 's1',
substring_index( substring_index( t1.attr_str, "-",- 2 ), '-', 1 ) AS 's2',
t2.keywords,
t3.attr_value
FROM
goods_sku AS t1
LEFT JOIN goods_base_goods AS t2 ON t1.base_id = t2.id
LEFT JOIN attribute_value AS t3 ON t3.id = substring_index( t1.attr_str, "-", 2 )
) AS a
LEFT JOIN attribute_value AS b ON a.s1 = b.id
LEFT JOIN attribute_value AS c ON a.s2 = c.id
mysql解析多属性商品导出
最新推荐文章于 2024-09-06 13:14:04 发布