Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8479261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:58:28+00:00 2026-06-10T18:58:28+00:00

I have table1 (col1,col2) and table2(col1,col2) as given below/ Now i need to replace

  • 0

I have table1 (col1,col2) and table2(col1,col2) as given below/

table definitions

Now i need to replace values of col2 of table1 with corresponding value of col1 and col2 from table2. So that the final table should look like this. how can we do this in query??

Final table

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:58:29+00:00Added an answer on June 10, 2026 at 6:58 pm

    I assume table1.col2 and table2.col2 have the same text type(?)

    update table1 set table1.col2=table2.col2
    from table1 
    join table2 on (table1.col2=table2.col1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following query SELECT table1.col1, table2.col2 FROM table1 INNER JOIN table2
SCENARIO: I have two tables, table1(col1 date) and table2(col2 varchar(20)). REQUIREMENT: Whenever anyone updated
I am using SQL SERVER 2005. I have a table table1(ID,col1,col2,col3,col4); Now I have
I have a table like Table1: col1 col2 col3 and have an index over
I have a table with the following Table1 col1 col2 ------------ 1 A 2
I have a table like below: COL1 | COL2 | COL3 ______________________ ITEM1 |
I have a table that looks like this: ID (pk,int) Col1 (nvarchar) Col2 (nvarchar)
Assume I have the following style table, col1 col2 and col3 have same value
i have some SQL code that is inserting values from another (non sql-based) system.
So I have two tables. Table1 have two columns, col1 and col2, where col1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.