You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
444 B

DROP VIEW IF EXISTS noshow_per_event_schedule_view;
CREATE VIEW noshow_per_event_schedule_view AS
(SELECT
ean.event_id, ean.event_schedule_id,
evsched.no_show_stat,
SUM(booking_expected) total_waiting,
SUM(booking_expected) total_bookings,
SUM(attendance) total_attendance,
SUM(booking_expected-attendance) total_noshow
FROM event_attendance_noshow ean
INNER JOIN event_schedule evsched USING (event_schedule_id)
GROUP BY event_schedule_id)