Results 1 to 2 of 2

Thread: Merge two tables

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2007
    Location
    Egypt
    Posts
    29

    Merge two tables

    i have The tables the same structure

    for Example
    table 1

    code name
    100 ahmed
    101 ali

    table 2

    code name
    200 sayd
    201 mohsen

    And I need to query the result can be

    code name
    100 ahmed
    101 ali
    200 sayd
    201 mohsen

    How do I do this by sql statment

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Merge two tables

    Use a Union, eg:
    Code:
    SELECT code, name FROM table1
    UNION ALL
    SELECT code, name FROM table2

Posting Permissions

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



Click Here to Expand Forum to Full Width