SELECT SQL_CALC_FOUND_ROWS 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-04-24 03:42:57')
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
69899 PUNK DRUNKERS(パンクドランカーズ) 北極あいつCAP - NAVY
69898 PUNK DRUNKERS(パンクドランカーズ) 北極あいつCAP - BLACK
71018 【予約商品】PUNK DRUNKERS コンピューターCAP - BLACK
71019 【予約商品】PUNK DRUNKERS コンピューターCAP - GRAY
66053 PUNK DRUNKERS (パンクドランカーズ) 肉P.CAP - NAVY
66055 PUNK DRUNKERS (パンクドランカーズ) アイツちゃんCAP - LT.YELLOW
66054 PUNK DRUNKERS (パンクドランカーズ) アイツちゃんCAP - BLACK
64448 PUNK DRUNKERS おねだん異常コーデュロイCAP - NAVY
64220 TOY MACHINE×PUNK DRUNKERS AITSU AND SECT YING YANG MESH CAP - BLACK
59948 PUNK DRUNKERS CAPのCAP - LT.BLUE
59947 PUNK DRUNKERS CAPのCAP - BLACK
59136 PUNK DRUNKERS [PDSxPAC-MAN]GAMER.CAP - BLACK
58232 PUNK DRUNKERS メタルロゴCAP - BLACK
58230 PUNK DRUNKERS スーパーPDSジェットCAP - BLACK
56682 PUNK DRUNKERS [PDSxGODZILLA]メカゴジラCAP - BLACK
56684 PUNK DRUNKERS ユル鮫人CAP - BLACK
54869 PUNK DRUNKERS 宇宙人スケボーCAP - BLACK
54870 PUNK DRUNKERS 宇宙人スケボーCAP - H.GRAY
10688 PUNK DRUNKERS B.B.CAP RED/BLACK
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