今月発売タイトル
select
gamelist.sellday as 発売日,
'<a href="http://erogamescape.dyndns.org/~ap2/ero/toukei_kaiseki/game.php?game='||gamelist.id||'">'||gamelist.gamename||'</a>' as タイトル,
avg(userreview.tokuten) as 平均点,
count(userreview.tokuten) as データ数,
'<a href="'||gamelist.shoukai||'" target="_blank">'||gamelist.shoukai||'</a>' as 紹介ページ,
'<a href="'||brandlist.url||'" target="_blank">'||brandlist.brandname||'</a>' as ソフトメーカー
from
gamelist left outer join userreview on gamelist.id = userreview.game,
brandlist
where
gamelist.model = 'PC' and
gamelist.erogame = 't' and
gamelist.brandname = brandlist.id and
gamelist.sellday >= date_trunc('month', current_timestamp) and
gamelist.sellday < date_trunc('month', current_timestamp + INTERVAL '1 month')
group by
gamelist.id,
gamelist.erogame,
gamelist.model,
gamelist.gamename,
gamelist.shoukai,
gamelist.sellday,
brandlist.brandname,
brandlist.url
order by gamelist.sellday