Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from sections
- where not exists (
- select top 1 * from sections as s
- join lessons as l on (s.Id = l.section_id)
- where s.Id = sections.Id
- and not exists (
- select * from reports as r
- where l.id = r.lesson_id
- and r.checked = 1
- )
- )
Add Comment
Please, Sign In to add comment