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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:48:41+00:00 2026-06-04T21:48:41+00:00

trying to build a query from a few tables here, and getting stumped on

  • 0

trying to build a query from a few tables here, and getting stumped on finalizing it:

Table 1 (circuits)

t1.circuit_id
t1.circuit_name

(sample data)

1234, test1
1235, test2
1236, test3

Table 2 (accounts)

t2.account_id
t2.account_username

(sample data)

100, user1
101, user2
102, user3

Table 3 (assignments)

t3.circuit_id
t3.assignment1 (references table 2 (account_id))
t3.assignment2 (references table 2 (account_id))
t3.assignment3 (references table 2 (account_id))

(sample data)

1234, 100, 101, 102
1235, 101, 101, 101
1236, 102, 102, 102

What I’m after is a result like following:

t1.circuit_id, t3.assignment1, t2.account_username, t3.assignment2, t2.account_username, t3.assignment3, t2.account_username.

1234, 100, user01, 101, user02, 102, user03
1235, 101, user02, 101, user02, 101, user02
1236, 102, user03, 102, user03, 102, user03

Many thanks,
–a

  • 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-04T21:48:41+00:00Added an answer on June 4, 2026 at 9:48 pm
    SELECT  t3.circuit_id, t3.assignment1, t21.account_username, t3.assignment2, t22.account_username, t3.assignment3, t23.account_username
    FROM    t3
    LEFT JOIN
            t2 t21
    ON      t21.account_id = t3.assigment1
    LEFT JOIN
            t2 t22
    ON      t22.account_id = t3.assigment2
    LEFT JOIN 
            t2 t23
    ON      t23.account_id = t3.assigment3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a query from the values of an array so
I'm trying to build this query select * from m_orders where year(order_date) = '2010'
Im trying to build a query that will fetch all changed rows from a
I'm trying to build a set of results from a query in a PHP
I'm trying to build a query from an Oracle 11g database to use in
I am trying to build a Linq to Entities query that joins a table
I am trying to build query in Play framework, I have select * from
I'm trying to build a query with Doctrine 2 $qb = $em->createQueryBuilder() ->select('*') ->from('Countries','c')
Hi I am trying to build a query parameter dynamically, and am getting an
I am trying to Build a simple search that first grabbs 'query' from a

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.