select indicator_code, short_name, year, value
from wdi_data, wdi_country
where
wdi_data.country_code = wdi_country.country_code
and wdi_data.indicator_code = ${selectedIndicator.indicator_code}
-- gnarly hack to get around the fact we can't interpolate lists for use with IN
and instr(${selectedCountries.map((c) => c.country_code).join(",")}, wdi_data.country_code) > 0