#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    6
    Rep Power
    0

    Select from two tables


    I have two tables one source table and one destination . Column names and data types of both table are same.


    source table (source)

    ID NAME
    1 aa
    2 bb
    3 cc
    . ...
    . ..
    . ..

    destination Table(dest)

    ID NAME
    1 aa
    2 bb


    I need destination table like

    destination table
    ID NAME
    1 aa
    2 bb
    3 cc
    . .....
    . ....


    I want to remove repeated rows
    Pls help me
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,785
    Rep Power
    348
    Code:
    SELECT id, name
    FROM source_table
    UNION 
    SELECT id, name
    FROM destination_table

    Comments on this post

    • debasisdas agrees
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Posts
    6
    Rep Power
    0

    Thanks


    Thanks

IMN logo majestic logo threadwatch logo seochat tools logo