# Reporte de mesas con encuestas calificadas y pendientes por calificar
select m.location, count(sa.id) as evaluated,
((select count(m2.id) from business_conference_meetings m2 where m2.business_conference_id = 3983 and m2.location = m.location and m2.end_date <= '2018-08-30 12:30:00') - count(sa.id)) as pending
from business_conference_meetings m
left join survey_answers sa on m.id = sa.related_entity_id
where m.business_conference_id = 3983 and sa.survey_id = 2561
and m.end_date <= '2018-08-30 12:30:00'
group by m.location
order by m.location asc;