0
最低値を取る: は、それぞれのproduct_idのために、少なくとも数は、各レベル分が空白除外と私はここにサンプルデータを持っている
期待される結果である何が必要なのさ
= 10093 3 183 184 185
しかし、私は、同じ製品IDの複数の行を有するので、それはレベル4
select
cc.product_id,
substring_index(substring_index(concat(cc.path, '/////'), '/', 2), '/', -1) as level_2,
substring_index(substring_index(concat(cc.path, '/////'), '/', 3), '/', -1) as level_3,
substring_index(substring_index(concat(cc.path, '/////'), '/', 4), '/', -1) as level_4,
substring_index(substring_index(concat(cc.path, '/////'), '/', 5), '/', -1) as level_5
from
cc
184上にブランク選択あなたが
0
値をフィルタリングするために集約する際