Advertisement
Maks140888

Untitled

Jun 8th, 2022
1,074
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select t.name, count(h.lesson_id) from sheldule h, teachers t
  2. where t.id = h.teacher_id
  3. and h.day_date between to_date('2022-06-06','YYYY-MM-DD') and to_date('2022-06-12','YYYY-MM-DD')
  4. group by t.name, h.day_date
  5. having count(h.lesson_id) = (
  6.     select count(teacher_id) from sheldule, teachers
  7.     where
  8.     day_date = h.day_date
  9.     and sheldule.teacher_id = teachers.id
  10.     and teachers.name = t.name
  11.     group by lesson_id
  12.     having count(teacher_id) > 1 ) 
  13.  
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement