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

  • Home
  • SEARCH
  • 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 9228009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:13:20+00:00 2026-06-18T05:13:20+00:00

I have a Table A as follows: ID NAME VALUE 1 abc 10 2

  • 0

I have a Table A as follows:

ID NAME VALUE
1  abc  10
2  xyz  15

I have a TABLE B as follows:

ID VALUE_1 VALUE_2 VALUE_3 TOTAL YEAR
1  0       0       0       0     2012
2  0       0       0       0     2013
3  0       0       0       0     2012

I want to UPDATE all rows in Table B and SET VALUE_2 column to the VALUE in Table A

I started my query statement as follows:

$query_string = '
UPDATE Table_B
SET VALUE_2 = (SELECT...something should go here I think)
WHERE Table_B.year = "2013"

Thank you for helping

  • 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-18T05:13:21+00:00Added an answer on June 18, 2026 at 5:13 am
    UPDATE  tableB b
            INNER JOIN tableA a
                ON a.ID = b.ID AND b.YEar = 2013
    SET     b.VALUE_2 = a.Name
    
    • SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 tables Table A is as follows: ID NAME VALUE 1 abc
I have an entity defined as follows @Entity(name = Report) @Table(name = REPORTS) @org.hibernate.annotations.Entity(dynamicInsert
I have a query as follows: String SQL = insert into table (id, name)
I have a domain object and annotated as follows @Entity @Table(name = REQUEST) public
I have a table inside a form that looks as follows: <td><input type=text name=code[0]
I have a table that looks like follows: NAME(varchar(6), STRING(varchar(250) ABCD '1 2 1
I have two tables as follows PRODUCT table Id | Name | Price And
Suppose you have a table as follows: Table Name: CUSTOMER Primary Key: CUSTOMER_ID +-------------+---------------+
I have a Table1 with structure as follows: Database name value SYSTEM SCOTT 2
I'm using PHP/MySql. If I have two tables (hypothetically) as follows: id name and

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.