SELECT item_name as アイテム名, YEAR(datetime) as 年, MONTH(datetime) as 月, DAY(datetime) as 日, REGEXP_REPLACE(enchants, ', .*', ']') as エンチャント, MAX(unit_cost) as 最高値, MIN(unit_cost) as 最低値, AVG(unit_cost) as 平均, SUM(count) as 取引数 FROM item_detail_tbl WHERE item_name = 'メモリアルクロース[0]' GROUP BY item_name, YEAR(datetime), MONTH(datetime), DAY(datetime), REGEXP_REPLACE(enchants, ', .*', ']') ORDER BY 2 desc,3 desc,4 desc, 8 desc;
SQL
SELECT item_name as アイテム名, YEAR(datetime) as 年, MONTH(datetime) as 月, DAY(datetime) as 日, REGEXP_REPLACE(enchants, ', .*', ']') as エンチャント, MAX(unit_cost) as 最高値, MIN(unit_cost) as 最低値, AVG(unit_cost) as 平均, SUM(count) as 取引数 FROM item_detail_tbl WHERE item_name = 'メモリアルクロース[0]' GROUP BY item_name, YEAR(datetime), MONTH(datetime), DAY(datetime), REGEXP_REPLACE(enchants, ', .*', ']') ORDER BY 2 desc,3 desc,4 desc, 8 desc;