I have a table of yearly data for various countries.
Not all countries have the same number of years of data.
If there is no row for a country/year pair, the implication is that the value is 0.
I'm trying to build a query that will use a JOIN
to add years and 0
for rows that don't yet exist.
current code:
CREATE TABLE years SELECT DISTINCT acq_year FROM final_data;
SELECT * FROM final_data CROSS JOIN years;