Guest User

Untitled

a guest
Nov 14th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. SELECT count(*)
  2. FROM inspections, businesses, agencies
  3. WHERE inspections.business_id = businesses.id
  4. AND businesses.agency_id = agencies.id
  5. AND agencies.slug = 'los_angeles'
  6. AND (CURRENT_DATE - inspections.date) <= 30
  7.  
  8.  
  9.  
  10. SELECT COUNT(*)
  11. FROM inspections
  12. INNER JOIN businesses ON inspections.business_id = businesses.id
  13. INNER JOIN agencies ON businesses.agency_id = agencies.id
  14. WHERE agencies.slug = 'los_angeles'
  15. AND (CURRENT_DATE - inspections.date) <= 30
Add Comment
Please, Sign In to add comment