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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:55:05+00:00 2026-05-13T18:55:05+00:00

An abstraction of the problem is like this: I have one table having a

  • 0

An abstraction of the problem is like this:

I have one table having a column called ‘country’. the value stored are name of the country, e.g. US, UK..

I have another table having a column called ‘country_code’. the value stored are numerical representations of the country, e.g. 12, 17…

how can I perform a join operation (e.g. inner join) based on these 2 tables? the difficulty is that the country and country_code has a one-to-one mapping but not directly equal to each other.

  • 1 1 Answer
  • 1 View
  • 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-13T18:55:05+00:00Added an answer on May 13, 2026 at 6:55 pm

    You could create a Mapping table containging the country and the country_code.

    I assume you cannot change the table containing the country_code to use the string representation from country, or add an int column to your countries table?

    Something like

    country_mappings

    • country varchar column
    • country_code int column
    • PRIMARY KEY country, country_mapping

    ‘

    SELECT  *
    FROM    countries c INNER JOIN
            country_mappings cm ON c.country = cm.country inner join
            your_other_table yot ON cm.country_code = yot.country_code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem, I am implementing a queue abstraction with RavenDB in
I'm having a very strange problem. I'm using dfs-datastores Pail abstraction to write data
interfaces provide a useful abstraction capability. One can have a class Foo implement some
Surely there is some kind of abstraction that allows for this? This is essentially
I'd like to create an abstraction in OpenGL of the environment settings(blending, stenciling, depth,
I have a business object that I would like to connect to my UI
I realize this is fairly abstract, but I'd like to do something not unlike
I'll be as direct as I can concerning this problem, because there must be
This looks like a long question because of all the context. There are 2
Consider we have a database that has a table, which is a record of

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.