Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to update this?

How to update this?

Scheduled Pinned Locked Moved Database
tutorialquestionannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arun Immanuel
    wrote on last edited by
    #1

    Hi, I have 2 tables ,say A and B.

    A: (ID Col1 Col2)
    B: (ID Col3)

    ID-Unique Column.

    I want to move col2 from A to B.
    Hence I have added a new column in table B, say col4.

    I want an update statement that will transfer A.col2 to B.Col4.

    Regards,
    Arun Kumar.A

    W 1 Reply Last reply
    0
    • A Arun Immanuel

      Hi, I have 2 tables ,say A and B.

      A: (ID Col1 Col2)
      B: (ID Col3)

      ID-Unique Column.

      I want to move col2 from A to B.
      Hence I have added a new column in table B, say col4.

      I want an update statement that will transfer A.col2 to B.Col4.

      Regards,
      Arun Kumar.A

      W Offline
      W Offline
      WoutL
      wrote on last edited by
      #2

      Update B Set Col4 = A.COL2 FROM B Inner Join A on A.ID = B.ID Or UPDATE B SET COL4 = (Select COL2 From A Where A.ID = B.ID)

      Wout Louwers

      A 1 Reply Last reply
      0
      • W WoutL

        Update B Set Col4 = A.COL2 FROM B Inner Join A on A.ID = B.ID Or UPDATE B SET COL4 = (Select COL2 From A Where A.ID = B.ID)

        Wout Louwers

        A Offline
        A Offline
        Arun Immanuel
        wrote on last edited by
        #3

        It is working. Thank U very much.

        Regards, Arun Kumar.A

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups