Professional Web Applications Themes

merge two table - Microsoft SQL / MS SQL Server

hi i need to merge two table ... without duplicates, and i need to prefer the rows of thhe first table. If there is the row with the id =1 in the first table i dont add the row of the second table with id 1 Thanks a lot i'm beginner with sql Carlo...

Sponsored Links
  1. #1

    Default merge two table

    hi
    i need to merge two table ... without duplicates, and i need to prefer the
    rows of thhe first table.
    If there is the row with the id =1 in the first table i dont add the row of
    the second table with id 1
    Thanks a lot
    i'm beginner with sql
    Carlo


    Sponsored Links
    Carlo Guest

  2. #2

    Default Re: merge two table

    SELECT <column list> FROM table1
    UNION ALL
    SELECT <column list> FROM table2
    WHERE NOT EXIST(SELECT NULL FROM table1 WHERE table1.id = table2.id)

    --
    Jacco Schalkwijk MCDBA, MCSD, MCSE
    Database Administrator
    Eurostop Ltd.


    "Carlo" <it> wrote in message
    news:phx.gbl... 
    of 


    Jacco Guest

  3. #3

    Default Re: merge two table

    you are great Jacco
    fast and perfect
    thanks a lot

    Carlo


    Carlo Guest

Similar Threads

  1. How do I merge Many PDF into One?
    By Samar_Roy@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 1
    Last Post: September 3rd, 04:57 PM
  2. Photoshop 7 Merge Linked vs. Merge Down
    By Seth_Thompson@adobeforums.com in forum Adobe Photoshop Mac CS, CS2 & CS3
    Replies: 0
    Last Post: February 25th, 08:14 PM
  3. Merge wont Merge Gradients?
    By Jason_Howard@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 1
    Last Post: February 13th, 07:52 PM
  4. Replies: 2
    Last Post: August 12th, 07:55 AM
  5. pdf merge
    By Henry in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 25th, 09:12 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139