Guest User

Untitled

a guest
May 26th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. select * from sections
  2. where not exists (
  3. select top 1 * from sections as s
  4. join lessons as l on (s.Id = l.section_id)
  5. where s.Id = sections.Id
  6. and not exists (
  7. select * from reports as r
  8. where l.id = r.lesson_id
  9. and r.checked = 1
  10. )
  11. )
Add Comment
Please, Sign In to add comment