1699. Number of Calls Between Two Persons ¶ SQL 1 2 3 4 5 6 7SELECT LEAST(from_id, to_id) AS person1, GREATEST(from_id, to_id) AS person2, COUNT(*) AS call_count, SUM(duration) AS total_duration FROM Calls GROUP BY 1, 2;