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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:39:11+00:00 2026-06-03T11:39:11+00:00

I have two tables in two databases. Database 1 which is named db1 which

  • 0

I have two tables in two databases. Database 1 which is named db1 which has table addresses. Database 2 which is name db2 which has table counties.

The structure is as follows:

addresses:

_id | address | countyID | cityID | stateID | postalCode | countryID

counties:

_id | stateID | countyName

Currently the countyID in the addresses table has the county name. What I need to do is take the value that is in addresses.countyID find it in counties and select the countyID from the counties table and then update the addresses table with the countyID.

End result, the addresses.countyID needs to have the countyID not the countyName.

Thank you, any help would be great. I have been trying all kind of things. I tried simple WHERE and JOIN but nothing seems to be working. I am using MySQL as my database.

  • 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-03T11:39:12+00:00Added an answer on June 3, 2026 at 11:39 am

    I just ended up creating a new table from the select results.

    CREATE TABLE AddressesCounties 
    SELECT db1.addresses._id, db1.addresses.address, db2.counties._id, db1.addresses.cityID, db1.addresses.stateID, db1.addresses.postalCode, db1.addresses.countryID 
    WHERE db1.addresses.countyID = db2.counties.countyName;
    

    This was a bit easier to create this temp table than altering real data. This way I could run my SELECT command and test my results before applying them.

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

Sidebar

Related Questions

I have two tables in my database named...Requests and Balance tracker which has no
I have two tables in my database named...Requests and Balance tracker which has no
Suppose I have a database named MyDatabase which has two tables - MyTable1 and
Let's say you have a database with two tables named clients and referrals. TABLE
I have a table and two databases which have the same table, but one
I have two database tables with the following structure: actions: action_id int(11) primary key
I have two tables in my database: user and media_contact . The media_contact table
I have a PostgreSQL database with two tables named user and group. They have
I have many databases in my server which have the same two tables. The
I am designing the database (MySQL) in which I have two tables Employees 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.