sql - How to create a SELECT query FROM "TABLE1 AND TABLE2" -


i have postgresql database, select permissions. in db there 2 tables same structure (the same columns).

i need write several query in each table , join results.

there way writing query one?

select   field1,   field2,   field3   table1 ,   table2   condition; 

select 2 tables. query = table1 or table1 + table2 have no answer , not question.

union all

select field1, field2, field3 table1 condition union select field1, field2, field3 table2 condition; 

or simplify condition

select * (   select field1, field2, field3     table1     union     select field1, field2, field3     table2 ) condition; 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -