RODB:過去1年の未精錬ノブレス価格表
SELECT item_name AS 'アイテム名',
SUM(cost) / SUM(count) AS '平均価格',
SUM(count) AS '件数'
FROM item_detail_tbl
WHERE item_name LIKE 'ノブレス%' AND
smelting = 0 AND
datetime >= (NOW() - INTERVAL 1 YEAR)
GROUP BY item_name
ORDER BY 2 DESC,1
オブリージュは精錬できないから精錬値smeltingがNULLでsmelting = 0の条件で対象外になる…と。