oracle - SQL select from several tables and output to several tables -


i have several tables of contain distinct id columns , have additional column containing dates. need retrieve ids corresponding dates tables. there way output ids , dates tables @ once , without creating duplicates ?

you can use union all combine multiple queries:

select 'table_a' source, table_a_id id, creation_date table_a union select 'table_b' source, table_b_id id, creation_date table_b union select 'table_c' source, table_c_id id, creation_date table_c; 

if need remove duplicate rows, can use union instead of union all, @ cost of performance.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -