Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: Compare data and add to table

    Hi all,

    Newbie here. I was wondering if any of you gurus could answer a question for me. Here is what I need to do (and I stress need):

    I have 2 tables.

    Table A has 3 columns, column 1 is unique customer numbers, column 2 is ticket numbers, column 3 is empty records.

    Table B has 2 columns, column 1 is unique customer numbers (same numbers, although not the same order as Table A) , column 2 is invoice numbers.

    I need to compare Table A where records in column 1 match records in column 1 in Table B. Where the records do match, I need to copy the records from Table B, column 2 to Table A column 3.

    Can anyone here help me with this, please? It would really get me out of a jam with this, since it is the last step I have to take to finally get this new app rolled out.

    Thanks a lot.

    Mark
    Last edited by raspis21; 03-04-04 at 17:07.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Some app, huh?!

    update a set Column3 = b.Column2
    from TableA a
    inner join TableB b
    on a.Column1 = b.Column1

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    Thank you, thank you, thank you.


    As you can see, I am in not a DB admin, nor do I have the resources on had to find the solution to this problem. (or I would have RTFM) Thanks lots, you have relieved me of quite a bit of stress. Thanks again.


    I'd buy you a beer if I could.

    Mark

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Heineken, please

Posting Permissions

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