Help with SQL Query

admin

Administrator
Staff member
I have a question I'm hoping someone could help me with. Lets say I have two mysql tables each with a field named "city"

I want to run a query to pull out all of the distinct city names between both tables.
so far with select distinct table1.city, t able2.city from table1, table2 i am able to get:
city1, city1
city2, city1
city3, city1
etc...

I know the above query is incorrect, but what is the right way to query and get one column of distinct cities from each table and be able to sort by city?

thanks in advance
 
Back
Top