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 6671765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:25:41+00:00 2026-05-26T03:25:41+00:00

HiI have two tables. tbl1 id int(11) NOT NULL positionName varchar(20) NULL positionId int(11)

  • 0

HiI have two tables.

tbl1

id             int(11)      NOT NULL

positionName   varchar(20)  NULL

positionId     int(11)      NULL

tbl2

positionId         int(11)      NOT NULL

positionName       varchar(20)  NULL

Originally, there is no column positionId in tbl1. Now will use positionId instead of positionName for tbl1.

The problem is there are over thousands of data already stored in both tables.

So, How can I successfully and quickly link to the correct positionId for the each data of tbl1 , in which positionName was previously used?

Is batch updating is a way?

Is there anyway that I can perform all things with SQL browser? If possible, I don’t want to use coding.

Thanks ahead.

  • 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-05-26T03:25:41+00:00Added an answer on May 26, 2026 at 3:25 am

    Are you looking for a multiple-table UPDATE, like this?

    UPDATE tbl1
    JOIN tbl2 ON tbl1.positionName = tbl2.positionName
    SET tbl1.positionId = tbl2.positionId
    WHERE tbl1.positionId IS NULL
    

    I’m assuming that positionName is unique in tbl2, but if it isn’t, you’ll need to consider how you wish to handle that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I want to have two tables each have an INT id column which
Hii, I have two entities with bidirectional association. Project.java class Project{ int project_id; @OneToMany(mappedBy=project)
Hi I'm struggling with the following problem. I have two tables one with employee
Hi I have two tables (users & friends) I need to connect to the
Hi I all I have two tables, yalladb_hotel and yalladb_room_types and their structure are
Hi i have a table as below with two column, 1.CODE, 2.Description Code Description
Hi I have two tables User and Pictures im trying to pull the pathname
hi i have a problem about adding data into two tables, heres the situation,
Hi I have 2 select queries that are returned to two seperate tables. While
Hi I have two tables which are related in the following way : Table1

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.