RODBさんでみるN鯖の封印されたカード100日平均価格
SELECT item_name AS 'アイテム名' ,
(SUM(cost) / SUM(count)) AS '平均価格',
SUM(count) AS '件数'
FROM item_detail_tbl
WHERE item_name LIKE '封印された%' AND
datetime > (NOW() - INTERVAL 100 DAY) AND
world LIKE 'Noatun'
GROUP BY item_name
ORDER BY `平均価格` DESC