Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unanswered: Problem in Copying data from one table to another

    Hi,


    I have a table

    Table1
    a b c d e f
    1 1 1 1 1 1
    1 1 1 2 1 3
    1 1 1 3 1 4

    In this table a,b,c,d are primary keys.

    I have another table with the same columns as Table1 but with "a,b,c,e" as primry fields.

    Now I want to copy the data of Table1 to Table2.

    But the query
    insert into Table2 ( select * from Table1) this gives unique constraint error.

    Please suggest a query so that I can copy all the unique data (i.e in which cnmbinaton a,b,c,e are distinct) from Table1 to Table2?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >(i.e in which cnmbinaton a,b,c,e are distinct)
    When multiple rows exist, how to determine which goes in TABLE2?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    It doesnot matter.... but prefably the first one.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Rows in a table are like balls in a basket.
    Which blue ball is the "first" ball?
    Just DISTINCT
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •