DB Error: syntax error:SELECT COUNT(*) AS order_count, goods_code, goods_name, price, contents, SUM(price_tax) + SUM(system_price_tax) AS price_tax_all, SUM(order_details_count) AS order_details_count, SUM(quantity) AS quantity, tax_type FROM "order" INNER JOIN (SELECT order_id, goods_code, goods_name, price, contents, COUNT(*) AS order_details_count, SUM(price_tax * quantity) AS price_tax, SUM(system_price_tax * quantity) AS system_price_tax, SUM(quantity) AS quantity, tax_type FROM order_delivery INNER JOIN order_details ON order_delivery.order_delivery_id = order_details.order_delivery_id INNER JOIN goods ON order_details.goods_id = goods.goods_id WHERE goods.naire_flg = 1 AND goods.status_flg = '0' AND goods.giftnavi_flg = '0' AND goods.catalog_flg = '0' AND NOW() BETWEEN goods.start_date AND goods.end_date GROUP BY order_id, goods_code, goods_name, price, tax_type, contents) AS order_delivery ON "order".order_id = order_delivery.order_id WHERE status_flg IN (0, 20) AND "order".site = '1' AND TO_CHAR("order".add_date, 'YYYY-MM-DD') >= '2024-10-19' AND "order".add_date <= NOW() AND genre IN (1) AND 1 = 1 GROUP BY goods_code, goods_name, price, tax_type, contents ORDER BY COUNT(*) DESC OFFSET 0 LIMIT 30:FILE=/home/web/www.giftnavi.jp/htdocs/sp/shussan/naire_30ranking.php:LINE=121