SELECT e.*, ISNULL(ec.TotalRegistrants, 0) FROM events e LEFT OUTER JOIN ( SELECT event_id, Count(registrant_id) AS TotalRegistrants FROM ... ... <看更多>
Search
Search
SELECT e.*, ISNULL(ec.TotalRegistrants, 0) FROM events e LEFT OUTER JOIN ( SELECT event_id, Count(registrant_id) AS TotalRegistrants FROM ... ... <看更多>
However this query returns 17 because there are 17 rows in the ports table: SELECT COUNT(ip_address) FROM `ports`;. See this SQL Fiddle. Sample data with 17 ... ... <看更多>