Blame | Last modification | View Log | Download | RSS feed
select
login.email,
count(*) tasks,
device.name
from
maintenance_schedule
join login using (login_id)
join device using (device_id)
where
device_id in (select device_id from device where removed_date is null)
and maintenance_schedule.removed_date is null
group by
login_id,
device.name
order by
login.email,
device.name;