I’m trying to work this query displays the buildings name once and I should be using a subquery as well but I’m really not sure where I would use it or go about it. I’ve tried using the distinct statement for building_name but it doesn’t work as expected and in my opinion it has to do with my select statement but I can’t figure it out. here is the query.
select distinct building_name, end_time as ‘earlier_course_end_time’, COUNT(end_time)
from course_sections
join section_location using (section_id)
join locations using (location_id)
where building_name <2
GROUP BY building_name, end_time
having COUNT(end_time) < 7
order by building_name
enter image description here
xaxka901 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.