Forum Stats

  • 3,873,419 Users
  • 2,266,565 Discussions
  • 7,911,531 Comments

Discussions

Merging of two identical tables

3004
3004 Member Posts: 204,171 Green Ribbon
--
How merge two identical table use SQL statement only with somw
option provided by oracle and without using INSERT statement
null

Comments

  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    --
    Hai Karunesh,
    I took some time and found the solution like this:
    Two tables are 'aaa' and 'bbb' are there,having identical columns
    and values in. Now to merge them and make another one I fallowed
    the steps
    sql> create table ab as select distinct a.name,b.roll
    from aaa a,bbb b;
    ------------Table created.
    Now this table 'ab' contains the same structure and value from
    both the tables'aaa' and 'bbb'.
    Hope I am quite close to your expected solution. still if you
    differ then please let me know.
    warm regards.
    Manoj ( Oracle-Miracle)
    ------------------------------------------

    Karunesh Bhardwaj (guest) wrote:
    : How merge two identical table use SQL statement only with somw
    : option provided by oracle and without using INSERT statement
    null
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    --
    hi manoj
    What if the two tables already exists and each containing some
    records
    think of some tool given by oracle for this purpose

    Regards
    Tejeshwar Singh
    ManojKumar (guest) wrote:
    : Hai Karunesh,
    : I took some time and found the solution like this:
    : Two tables are 'aaa' and 'bbb' are there,having identical
    columns
    : and values in. Now to merge them and make another one I
    fallowed
    : the steps
    : sql> create table ab as select distinct a.name,b.roll
    : from aaa a,bbb b;
    : ------------Table created.
    : Now this table 'ab' contains the same structure and value from
    : both the tables'aaa' and 'bbb'.
    : Hope I am quite close to your expected solution. still if you
    : differ then please let me know.
    : warm regards.
    : Manoj ( Oracle-Miracle)
    : ------------------------------------------
    : Karunesh Bhardwaj (guest) wrote:
    : : How merge two identical table use SQL statement only with
    somw
    : : option provided by oracle and without using INSERT statement
    null
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    --
    hi
    if you just want to create the table and dont want to populate
    the new table you can do it in the following way

    create table ab as select distinct a.name,b.roll
    from aaa a,bbb b
    where 1= 2;

    Tejeshwar Singh (guest) wrote:
    : hi manoj
    : What if the two tables already exists and each containing some
    : records
    : think of some tool given by oracle for this purpose
    : Regards
    : Tejeshwar Singh
    : ManojKumar (guest) wrote:
    : : Hai Karunesh,
    : : I took some time and found the solution like
    this:
    : : Two tables are 'aaa' and 'bbb' are there,having identical
    : columns
    : : and values in. Now to merge them and make another one I
    : fallowed
    : : the steps
    : : sql> create table ab as select distinct a.name,b.roll
    : : from aaa a,bbb b;
    : : ------------Table created.
    : : Now this table 'ab' contains the same structure and value
    from
    : : both the tables'aaa' and 'bbb'.
    : : Hope I am quite close to your expected solution. still if you
    : : differ then please let me know.
    : : warm regards.
    : : Manoj ( Oracle-Miracle)
    : : ------------------------------------------
    : : Karunesh Bhardwaj (guest) wrote:
    : : : How merge two identical table use SQL statement only with
    : somw
    : : : option provided by oracle and without using INSERT statement
    null
This discussion has been closed.