select count(*) as cnt from product_m a inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 order by code2; select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '10') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '11') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '12') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '10') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '11') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '12') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '10') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '11') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '12') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '10') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '11') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '12') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,40,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 order by code2; select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '8') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '9') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '40') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '49') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77); select count(*) as cnt from product_m a inner join product_d b on a.code = b.pcode and b.ocode = '1' inner join product_s c on a.code = c.pcode where c.prod_cate_code_s in (select code from product_category_s a where a.lv = '2' and a.parent_code = '2') and c.p_use = 1 and a.hidden<>1 and p_soldout <> 1 and a.code not in (1,17,34,36,37,49,51,52,53,55,56,58,61,62,63,64,67,68,69,70,72,74,75,76,81,28,48,66,77);