How to find the common values from two different tables having a common column

You can do an inner join on the city column, to find values that exist in both tables.

select
    -- Output the city from either table (since it will be the same)
    t1.city 
from
    -- Join table1 and table2 together, on a matching city column
    table1 t1 join table2 t2 on (t1.city=t2.city)
group by 
    -- Only return a single row per city
    t1.city

Browse More Popular Posts

Leave a Comment