我有两张表格如下
表产品
def my_converter(value: object) -> float:
# add all your "known" value conversions and fallbacks
converted_value = float(value)
return converted_value
df.apply(pd.to_numeric, converter=my_converted)
表类别
-product_id- -categorie ids-
1 2,4,5,6
2 1,4,3
4 3,5
我需要这种格式的结果
c-category_id- -(catname)-
1 cat1
2 cat2
3 cat3
4 cat4
5 cat5
6 cat6
答案 0 :(得分:1)
SELECT a.product_id,
b.catname
FROM products a
INNER JOIN category b
ON FIND_IN_SET(b.category_id, a.categorie_ids) > 0
ORDER BY a.product_id
现场演示