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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:10:40+00:00 2026-05-24T10:10:40+00:00

Probably a very basic solution to this, but I can’t seem to figure it

  • 0

Probably a very basic solution to this, but I can’t seem to figure it out. I’m trying to match
multiple ID’s in one table towards another.

Structure is something like this,

tt_staff (ID - name)
2 - Lenny
3 - Carl

tt_run (producer1 - producer2)
2 (i.e Lenny)
3 (i.e Carl)

I want to create a view with a single row that shows me the names of both Carl and Lenny, rather then their ID’s.

Tried the following,

SELECT e.*, run.*, s.s_name FROM tt_run AS run, tt_events AS e, tt_staff AS s
WHERE e.e_ID = run.e_ID
AND run.e_bandproducer1 = s.s_ID 
AND run.e_bandproducer2 = s.s_ID

This obviously doesn’t work, since the ID is found on producer1. I’ve also tried with UNION, but not familiar enough with it (I did manage to get the right result, but in two rows).

As always, thanks for any replies.

  • 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-24T10:10:41+00:00Added an answer on May 24, 2026 at 10:10 am

    It looks like you just need to join tt_staff twice:

    SELECT e.*, r.*, s1.s_name, s2.s_name
      FROM tt_events e
      INNER JOIN tt_run r ON e.e_ID = r.e_ID
      INNER JOIN tt_staff s1 ON r.e_bandproducer1 = s1.s_ID
      INNER JOIN tt_staff s2 ON r.e_bandproducer2 = s2.s_ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This probably is a very very basic question but i can't seem to find
I'm probably missing something very basic but I cannot figure out why I get
This is probably very basic stuff, but please bear in mind I am completely
This is probably something very basic, but my Erlang installation is doggedly rejecting my
This is probably a very basic question but I haven't found any detailed information
This is probably very basic, but it's giving me a headache, and I'm not
All, This is probably very basic, but I cannot find an answer that works
I realize that this is probably a very basic question, but I have spent
This is probably a very basic question, but I'm really new to generics in
Ok, this is probably something very basic I don't understand about actionscript, but I

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.