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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:41:21+00:00 2026-06-12T04:41:21+00:00

I have two tables: Table Users UserId Name 1 John 2 Alice 3 Tom

  • 0

I have two tables:

Table Users

UserId     Name
1          John
2          Alice
3          Tom
4          Charles

and

Table Clients

Id         Name1          Name2      Name3
1            1              3          4
2            2              1          3

I would like to make a SQL query where for

Clients.Id = 1

the results are like:


Id         Name1          Name2       Name3
1          John            Tom       Charles

Using INNER JOIN I am able to do that for each column from Clients but not for the whole record (all three columns).

  • 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-12T04:41:22+00:00Added an answer on June 12, 2026 at 4:41 am

    You need to join table users thrice on table client.

    SELECT  a.ID,
            b.name name1,
            c.name name2,
            d.name name3
    FROM    clients a
            INNER JOIN users b
                ON a.name1 = b.userID
            INNER JOIN users c
                ON a.name2 = c.userID
            INNER JOIN users d
                ON a.name3 = d.userID
    WHERE   a.ID = 1
    

    SQLFiddle Demo

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

Sidebar

Related Questions

I have two tables like this: Table Name: users emx | userid --------------- 1
I Have two tables: Users and News. Table News has columns id, name, createdby,
I have two tables Schools and Users Table School ----------------------------------------------------- | id | name
I have two tables user table user_id | name | 1 | peter |
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
I have two tables on MySQL, with this structure: Users: id | name Accounts:
I have two tables in my database users table : +-----------+---------------------+---------+---------+ | id |
I have a SQL database with two tables like this: Users Id (PK) Name
I have two tables: Recipes RecipeId | UserId | Name | etc. and RecipeRatings
I have two tables users and *activation_details* Users table has these data. uid is

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.