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 17:33:30')
AND ( p.sales_end_datetime IS NULL AND p.deliv_date_id != 9 )
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 60, 60
35011 PUNK DRUNKERS さかなナイロンジェットCAP BLACK
35012 PUNK DRUNKERS 出刃CAP GRAY
35013 PUNK DRUNKERS 出刃CAP ORANGE
36322 PUNK DRUNKERS 虎ドットCAP BLACK
36323 PUNK DRUNKERS 虎ドットCAP NAVY
39435 PUNK DRUNKERS 89禁CAP BLACK
39436 PUNK DRUNKERS 89禁CAP BEIGE
39492 PUNK DRUNKERS ポリエステルCAP BLACK/D.GREEN
39493 PUNK DRUNKERS ポリエステルCAP NAVY/KHAKI
40761 PUNK DRUNKERS 元ヤンメッシュCAP BLACK
40762 PUNK DRUNKERS 元ヤンメッシュCAP NAVY
40763 PUNK DRUNKERS 元ヤンメッシュCAP WHITE/BALCK
40764 PUNK DRUNKERS PDナイロンCAP WHITE
40765 PUNK DRUNKERS PDナイロンCAP BLACK
40766 PUNK DRUNKERS ワンCAP BEIGE
40767 PUNK DRUNKERS ワンCAP LT.PINK
40768 PUNK DRUNKERS ワンCAP SKY.BLUE
43009 PUNK DRUNKERS あいつになれるCAP RED
43010 PUNK DRUNKERS あいつになれるCAP BLACK
43210 PUNK DRUNKERS 逆セレブCAP NAVY
43211 PUNK DRUNKERS 逆セレブCAP GRAY
43212 PUNK DRUNKERS 逆セレブCAP GREEN
43213 PUNK DRUNKERS 逆セレブCAP RED
43437 PUNK DRUNKERS オシャレワッペンCAP BLACK
43438 PUNK DRUNKERS オシャレワッペンCAP OLIVE
43439 PUNK DRUNKERS サプライズコーデュロイCAP GRAY
43440 PUNK DRUNKERS サプライズコーデュロイCAP NAVY
43441 PUNK DRUNKERS サプライズコーデュロイCAP BEIGE
43442 PUNK DRUNKERS サプライズコーデュロイCAP LT.PINK
45185 PUNK DRUNKERS [PDSxHEADGOONIE]パンクドグーニーCAP LT.BLUE
45186 PUNK DRUNKERS [PDSxHEADGOONIE]パンクドグーニーCAP BLACK
47881 PUNK DRUNKERS ブッチギリメッシュCAP WHITE
47882 PUNK DRUNKERS ブッチギリメッシュCAP BLACK
48600 PUNK DRUNKERS パンクさんCAP BLACK
48601 PUNK DRUNKERS パンクさんCAP OLIVE
48602 PUNK DRUNKERS 折りたたみCAP BLACK
49699 PUNK DRUNKERS [PDSx野性爆弾くっきー]バランスおじさんCAP NAVY
49700 PUNK DRUNKERS 切札ジェットCAP BLACK
49701 PUNK DRUNKERS 切札ジェットCAP CAMO
50460 PUNK DRUNKERS [PDSxTOY MACHINE]MONSTERxあいつCAP BLACK
51766 PUNK DRUNKERS PKDSフライトCAP NAVY
51767 PUNK DRUNKERS PKDSフライトCAP OLIVE