A facilities team wants to identify sites with the most unresolved work orders. Write a SQL query to return the top 10 sites by unresolved tickets created during the 30-day period ending on September 4, 2026.
Output
- One row per site with columns
site_id, site_name, client_name, and unresolved_ticket_count.
- Include only work orders with status
open, in_progress, or pending, created from August 5, 2026 through September 4, 2026, inclusive.
- Exclude work orders without a matching site or client.
- Sort by unresolved ticket count descending, then
site_id ascending for ties, and return at most 10 rows.
- Rows with statuses or dates outside the specified scope are excluded.