Skip to content

1445. Apples & Oranges 👍

1
2
3
4
5
SELECT
  sale_date,
  SUM(IF(fruit = 'apples', sold_num, -sold_num)) AS diff
FROM Sales
GROUP BY 1;