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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:57:10+00:00 2026-06-14T10:57:10+00:00

Stupid question, but I couldn’t find the right search for this question and I’m

  • 0

Stupid question, but I couldn’t find the right search for this question and I’m having a mind block. I have a table with keys from a reference table and I want to avoid using a loop to select the records without having duplicates. I need to get Mode 1-5 joined so I can get the names without having duplicates. Please leave comments so I can clarify.

Mode(1-5) are ModeIDs

Example:

Table to Join

ID
Mode1
Mode2
Mode3
Mode4
Mode5

Reference Table

ModeID
ModeName
  • 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-14T10:57:11+00:00Added an answer on June 14, 2026 at 10:57 am

    This is the answer to your question:

    SELECT 
        m1.ModeName,
        m2.ModeName,
        m3.ModeName,
        m4.ModeName,
        m5.ModeName
    FROM Modes m
    LEFT JOIN Ref m1 on m1.ModeID = m.Mode1
    LEFT JOIN Ref m2 on m2.ModeID = m.Mode2
    LEFT JOIN Ref m3 on m3.ModeID = m.Mode3
    LEFT JOIN Ref m4 on m4.ModeID = m.Mode4
    LEFT JOIN Ref m5 on m5.ModeID = m.Mode5
    

    But I would suggest that there’s a problem with your DB design. You should be using a join table.

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

Sidebar

Related Questions

This question may sound stupid. But I do search online and couldn't find a
this may be a stupid question but i couldn't find answer anywhere. I'm a
I hope this isn't a completely stupid question, but I just couldn't find the
maybe my question is a little stupid but I couldn't find this answer. What
Apologies if this is a stupid question, but I'm a newbie and couldn't find
This may be a stupid question but I have a code with the following
this is probably a stupid question but I can't seem to find the answer.
This is likely a stupid question but I always find myself wondering which is
Probably a stupid question, but I couldn't find anything searching... Is there a standard
This question is so stupid... Anyway, i just can't find the right information, because

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.