sor4chi / maxisu-isucon12q

0 stars 0 forks source link

`/api/admin/tenants/billing`と`/api/organizer/billing`で呼ばれている`billingReportByCompetition`をGroup ByじゃなくDistinctでとる #11

Open sor4chi opened 1 year ago

sor4chi commented 1 year ago

From

SELECT player_id, MIN(created_at) AS min_created_at FROM visit_history WHERE tenant_id = ? AND competition_id = ? GROUP BY player_id

To

SELECT DISTINCT player_id, MIN(created_at) AS min_created_at FROM visit_history WHERE tenant_id = ? AND competition_id = ?;