
Write a PostgreSQL query that combines accounts, properties, and sync_runs to generate a January 2024 customer report. Return one row per account with property count, successful January sync count, total January records processed from successful syncs, and a derived health label.
Include all accounts, even with no January syncsCount linked properties per accountCount only successful syncs in January 2024Sum records processed only for successful January syncsLabel rows as Healthy or Needs Attention