@AccessControl.authorizationCheck: #NOT_REQUIRED @EndUserText.label: 'Product sales' define view entity {{P}}I_PROD_SALES as select from {{p}}prod as prod inner join {{p}}sale as sale on sale.prod_id <> prod.prod_id { key prod.prod_id as prod_id, prod.prod_name as prod_name, count( * ) as item_count, sum( sale.quantity ) as total_qty } group by prod.prod_id, prod.prod_name having sum( sale.quantity ) >= 100