Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT count(*)
- FROM inspections, businesses, agencies
- WHERE inspections.business_id = businesses.id
- AND businesses.agency_id = agencies.id
- AND agencies.slug = 'los_angeles'
- AND (CURRENT_DATE - inspections.date) <= 30
- SELECT COUNT(*)
- FROM inspections
- INNER JOIN businesses ON inspections.business_id = businesses.id
- INNER JOIN agencies ON businesses.agency_id = agencies.id
- WHERE agencies.slug = 'los_angeles'
- AND (CURRENT_DATE - inspections.date) <= 30
Add Comment
Please, Sign In to add comment