I have 2 tables HOUSES and COUNTRIES
HOUSES
country_code – example ‘ES’ for Spain
COUNTRIES
country_code – example ‘ES’ for Spain
houses_total – example 20 – total houses in ‘ES’ Spain found in the HOUSES table
I need to count the number of houses in each HOUSES.country_code in the HOUSES table and update the COUNTRIES table with that total in COUNTRIES.houses_total
Many thanks
Use join with update:
Try below: