MySQL:FIND_IN_SET的应用

语句:
SELECT
( SELECT GROUP_CONCAT( title ) FROM shop_goods_spu_specification_sub WHERE FIND_IN_SET( id, sku.spec_ids ) ) AS title
FROM
shop_goods_cart cart
LEFT JOIN shop_goods_sku sku ON cart.sku_id = sku.id
WHERE
sku.id =1 ;

shop_goods_sku:

shop_goods_spu_specification_sub:

查询结果:

参考链接:https://www.cnblogs.com/yangxq/p/3907513.html

posted @ 2021-02-20 17:14  DiligentCoder  阅读(58)  评论(0编辑  收藏  举报