How do I strip results with null (or zero) results when using GROUP BY and CASE WHEN logic?
a hypothetical example is:
SELECT City, SUM(case when name2015 = 'Jane' then income2015 end) income2015_total, SUM(case when name2020 = 'Jane' then income2020 end) income2020_total from finaldata GROUP BY City
with a database of all people. This will return 3 columns, city, total income of all Janes for 2015, and total income for all Janes for 2020. However, it will return a row for all cities even if they have no Janes. These cities will have null results in the last 2 columns. How do I strip these out in the query so I only get rows for cities that contain at least 1 Jane?