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 =17
)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-05-01 16:42:36')
AND pc.price02 > 909
AND price02 <= 2727
AND p.product_id IN (SELECT product_id FROM dtb_product_categories WHERE category_id = 371)
AND pc.del_flg = 0
GROUP BY p.product_id
ORDER BY p.update_date DESC
LIMIT 0, 25
20432 PUNK DRUNKERS ブランドチックCAP BLACK
20433 PUNK DRUNKERS ブランドチックCAP BLUE
20434 PUNK DRUNKERS 王CAP BLACK/RED
20435 PUNK DRUNKERS あいつ目CAP CHARCOAL
20436 PUNK DRUNKERS あいつ目CAP GRAY
20437 PUNK DRUNKERS 耳に鉛筆ニットCAP BLACK
20438 PUNK DRUNKERS 耳に鉛筆ニットCAP ENJI
20439 PUNK DRUNKERS 耳に鉛筆ニットCAP MASTARD
22304 PUNK DRUNKERS KY CAP NAVY
22305 PUNK DRUNKERS KY CAP GRAY
22306 PUNK DRUNKERS ドット幽霊CAP BLUE
22307 PUNK DRUNKERS ドット幽霊CAP BLACK
22308 PUNK DRUNKERS ドット幽霊CAP NAVY
22371 PUNK DRUNKERS 竹とん帽ハット BLACK
24620 PUNK DRUNKERS PUNK DRUNKバケットハット BLUE
24621 PUNK DRUNKERS PUNK DRUNKバケットハット LT.BLUE
24987 PUNK DRUNKERS PKDSメッシュCAP BLACK/WHITE
24988 PUNK DRUNKERS PKDSメッシュCAP GRAY
25529 PUNK DRUNKERS ゲームボーシ BLACK/BLUE
25530 PUNK DRUNKERS ゲームボーシ GRAY/BLACK
28503 PUNK DRUNKERS ドクターPUNKDメッシュCAP BLACK
28504 PUNK DRUNKERS ドクターPUNKDメッシュCAP RED
28506 PUNK DRUNKERS ドクターPUNKDメッシュCAP WHITE/NAVY
28518 PUNK DRUNKERS P.CAP NAVY
28519 PUNK DRUNKERS P.CAP GRAY