検索は
プッシュマスター エルボ 16
などとアンド検索をする
次の2つのSQL結果をつなげる
unionでつなげるとorder byが使えないので調査が必要
select cg.cg_name from category_sku cs left join sku s on cs.cs_skuid = s.sku_id left join price p on cs.cs_skuid = p.p_skuid left join category_group cg on cs.cs_cgid = cg.cg_id left join (select cp_skuid ,cp_price from cust_price where del_flg = 0 and cp_coid = 8993) cp on cs.cs_skuid = cp.cp_skuid where p.del_flg = 0 and s.sku_name like '%プッシュマスター%' and s.sku_name like '%エルボ%' and s.sku_name like '%16%' order by cg_order
select cs.cs_skuid ,s.sku_name ,if(cp.cp_price is null, p.p_up,cp.cp_price) as price ,p.p_fp from category_sku cs left join sku s on cs.cs_skuid = s.sku_id left join price p on cs.cs_skuid = p.p_skuid left join category_group cg on cs.cs_cgid = cg.cg_id left join (select cp_skuid ,cp_price from cust_price where del_flg = 0 and cp_coid = 8993) cp on cs.cs_skuid = cp.cp_skuid where p.del_flg = 0 and s.sku_name like '%プッシュマスター%' and s.sku_name like '%エルボ%' and s.sku_name like '%16%' order by cg_order,cs.cs_order