Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
16 lines
476 B
Plaintext
16 lines
476 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Album statistics'
|
|
define view entity {{P}}I_ALBUM_STATS
|
|
as select from {{p}}album as alb
|
|
left outer join {{p}}track as trk on trk.album_id = alb.album_id
|
|
{
|
|
key alb.album_id as album_id,
|
|
alb.title as title,
|
|
count( * ) as track_count,
|
|
sum( trk.play_sec ) as total_seconds,
|
|
max( trk.play_sec ) as longest_seconds
|
|
}
|
|
group by
|
|
alb.album_id,
|
|
alb.title
|