SELECT SQL_CALC_FOUND_ROWS p.del_flg AS new_arrival_content, p.product_id, p.main_image, p.main_list_comment, p.comment2, p.update_date, p.sub_title6, MAX(price02), MAX(price03), MAX(stock), pc.point_rate, p.sales_datetime, p.sales_end_datetime, IF(p.tweet=p.tweet, 1, 0) AS tweet, p.name, p.movie_s, GROUP_CONCAT(cc.name separator ' ') AS classlist, GROUP_CONCAT(pc.stock separator ' ') AS stocklist
FROM (
SELECT product_id, category_id
FROM dtb_product_categories
WHERE category_id =97
)AS pcat
LEFT JOIN dtb_products AS p ON p.product_id = pcat.product_id
LEFT JOIN dtb_products_class AS pc ON p.product_id = pc.product_id
LEFT JOIN dtb_classcategory AS cc ON pc.classcategory_id1 = cc.classcategory_id
WHERE p.product_id IS NOT NULL
AND p.del_flg !=1
AND p.status =1
AND (p.sales_end_datetime IS NULL OR p.sales_end_datetime >= '2024-04-28 04:01:21')
AND p.product_id IN (SELECT product_id FROM dtb_product_categories WHERE category_id = 420)
AND pc.del_flg = 0
GROUP BY p.product_id
LIMIT 0, 25
17933 アマツカミ あまちゅかみ R-7/S
17934 アマツカミ 溺死 R-7/S
21402 アマツカミ 「溺死」 R-7/S WHITE
33404 アマツカミ 御伽 Long T-Shirt Black
33405 アマツカミ 御伽 Long T-Shirt White
33406 アマツカミ 心中 Long T-Shirt Black
33407 アマツカミ 心中 Long T-Shirt White
37019 アマツカミ 遊女 Long Sleeve White
37020 アマツカミ 遊女 Long Sleeve Black
37021 アマツカミ 鳥居 Long Sleeve Black
37022 アマツカミ 鳥居 Long Sleeve White
41540 アマツカミ 死文字 Long T-Shirt Black
41541 アマツカミ 死文字 Long T-Shirt White
41542 アマツカミ 狐繰 Long T-Shirt Black
41543 アマツカミ 狐繰 Long T-Shirt White
41544 アマツカミ 棘薔薇 Long T-shirt Black
41545 アマツカミ 棘薔薇 Long T-shirt White
44146 アマツカミ 葬/Burial Long T-Shirts White
44147 アマツカミ 葬/Burial Long T-Shirts Black
44148 アマツカミ 狐繰/Ouija Long T-shirts White
44149 アマツカミ 狐繰/Ouija Long T-shirts Black
49121 アマツカミ 棘薔薇/Rose Needle Long T-Shirts Black
49122 アマツカミ 棘薔薇/Rose Needle Long T-Shirts White
49123 アマツカミ 闇/Dark Long T-Shirts Black
49124 アマツカミ 病/Sick Long T-Shirts White