Replace column

  • Hello People,

    How do I replace a column of data with new column data in another table .

    example : table 1

    id1 id2

    1 2

    3 4

    table 2 note: All columns are Int datatype only.

    id3

    5

    6

    I want to replace 2 and 4 with 5 and 6.

    Thanks for the help.

  • What are you trying to do with this replacement!? It hasn't logic to do like that, how many records do you have in both tables what is the right purpose to replace that col!?

    Be more specific what are you trying to do with this replacement!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Table1 has Emp id and table2 has manager id ..

    In my scenario i want see the emp who has managers.

    Table 1

    emp id

    2

    3

    5

    table 2

    manager id

    1

    4

    null

  • I want to replace 2 and 4 with 5 and 6.

    --edited and removed when i found out it was homework.

    For homework, me pasting a solution helps noone; you never learn the concepts that you'll need later.

    show us what you've tried, what you think and what didn't work.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • what happens if i have more records. Its my class home work.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply