@AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Play statistics' define view entity {{P}}I_PLAY_STATS as select from {{p}}play as play left outer join {{p}}perf as perf on perf.play_id = play.play_id { key play.play_id as play_id, play.title as title, count( * ) as performance_count, sum( perf.tickets_sold ) as total_tickets, sum( perf.revenue ) as total_revenue } group by play.play_id, play.title