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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:49:00+00:00 2026-05-24T11:49:00+00:00

So, I have two tables, Table R and Table N. The data in Table

  • 0

So, I have two tables, Table R and Table N. The data in Table R is from Table N. My problem is I don’t know the SELECT query that will display the result such as below, because there are 4 names, and SQL can only choose 1. Is there a query or any other way to get the result?

Table R:
Id1 Id2 Id3 Id4
1   3   5   7
2   4   6   8

Table N:
Id  Name
1   A
2   B
3   C
4   D
5   E
6   F
7   G
8   H

After the SELECT statement, the result should look like this:

Name1   Name2   Name3   Name4
A       C       E       G
B       D       F       H

Anyway, thanks 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-05-24T11:49:01+00:00Added an answer on May 24, 2026 at 11:49 am
    SELECT
      N1.Name AS `Name1`,
      N2.Name AS `Name2`,
      N3.Name AS `Name3`,
      N4.Name AS `Name4`
    FROM
      R
    INNER JOIN
      N N1
    ON
      N1.Id = R.Id1
    INNER JOIN
      N N2
    ON
      N2.Id = R.Id2
    INNER JOIN
      N N3
    ON
      N3.Id = R.Id3
    INNER JOIN
      N N4
    ON
      N4.Id = R.Id4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an INSERT query that is pulling data from two tables and inserting
I have two different tables from which I need to pull data blogs which
I have two tables users registered_members I want to confirm values from user table
I have two tables that are indirectly related by another table TableA - ID,
Lets say I have data in two tables. In one I have Order ID
I have a two-dimensional array (of Strings) which make up my data table (of
I have a simple data model of two tables, email and recipients, email can
I have some data I am querying. The table is composed of two columns
I have two tables: Table 1: ID, PersonCode, Name, Table 2: ID, Table1ID, Location,
I have two tables: a source table and a target table. The target table

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.