Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select *
- from (
- select
- a.gateway_id,
- b.title gateway,
- c.title rca,
- sum(a.total_minutes) sum_minutes
- from report_total_minutes_by_day a
- inner join data_gateway b on a.gateway_id = b.id
- inner join data_group_rca c on b.rca_id = c.id
- where b.is_deleted = 0
- and c.is_deleted = 0
- and a.report_date = current_date
- group by a.gateway_id
- ) d
- where d.sum_minutes > 1000;
Advertisement
Add Comment
Please, Sign In to add comment