RODB:過去三ヶ月の衣装最終値トップ100
SELECT detail.item_name AS 'アイテム名',
detail.unit_cost AS '最終値',
detail.datetime AS '取引日時'
FROM item_detail_tbl detail
INNER JOIN (SELECT item_name, MAX(datetime) AS max_datetime FROM item_detail_tbl WHERE item_name LIKE '[衣装]%' AND datetime >= (NOW() - INTERVAL 3 MONTH) GROUP BY item_name) latest
ON (detail.item_name = latest.item_name AND detail.datetime = latest.max_datetime)
ORDER BY 2 DESC,1
LIMIT 100
ラグナロクオンラインユーザ向けのMastodonインスタンス。
@iludea_234 https://rodb.aws.0nyx.net/ropma/index.php?route=/table/sql&db=pigeon&table=item_detail_tbl
ここに文を入れて下の実行を押すと、こんな感じの結果が得られる訳ですな。