Forum Stats

  • 3,734,281 Users
  • 2,246,937 Discussions
  • 7,857,218 Comments

Discussions

Create one tables from 2 different tables

lesak
lesak Member Posts: 532 Blue Ribbon
edited Sep 8, 2008 11:21AM in General Database Discussions
Hi,

How I can create one table from 2 different tables. Source tables have data and I want to include it in new table.
I try this:

create table NEW_ONE
select * from OLD_ONE
union
select * from OLD_ONE2;

But it didn't work correctly :/
Tagged:

Best Answer

  • Robert Geier
    Robert Geier Member Posts: 2,989
    Accepted Answer
    Maybe you mean this ? Not sure what your join condition is ?

    create table NEW_ONE as
    select o1.id_oo, o1.name_oo, o2.id_002, o2.name_oo2
    from old_one o1, old_one2 o2
    where o1.id_oo = o2.id_oo2; -- PLEASE CHECK THIS JOIN CONDITION

Answers

This discussion has been closed.