VikaS GuttE
VikaS GuttE

Reputation: 1704

how to merge/Combine two tables in oracle

Hello I want merge two tables in oracle like below -

enter image description here

I tried below answer from stack overflow but not getting answer like Output table

Combining Two Tables With Oracle SQL

Upvotes: 0

Views: 1122

Answers (2)

Vikram Jain
Vikram Jain

Reputation: 5588

Please try with below query:

select * from (
select id, name, rate,total from table1
union all
select id, name, rate,total from table2
) as  t
order by t.id asc

Upvotes: 1

Fahmi
Fahmi

Reputation: 37473

use union all

select id, name, rate,total from table1
union all
select id, name, rate,total from table2

Upvotes: 1

Related Questions