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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:48:33+00:00 2026-05-21T15:48:33+00:00

There are three fields in a table, all of them refer the same field

  • 0

There are three fields in a table, all of them refer the same field in another table, like this:

table1
-------
! a_term_id* ! b_term_id* ! c_term_id* !
!            !            !            !

table2
-------

! term_id ! term_title ! term_description !
! ------- !            !                  !

columns a_term_id, b_term_id, c_term_id all refer to term_id

How should I write the SQL statement to retrieve the three fields’ info?

  • 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-21T15:48:33+00:00Added an answer on May 21, 2026 at 3:48 pm

    I think you need to know how Sql_Join works. Here on W3Schools you can find useful examples.

    A simple example:

    SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
    FROM Persons
    INNER JOIN Orders
    ON Persons.P_Id=Orders.P_Id
    ORDER BY Persons.LastName
    

    EDIT

    You can try something like this:

    SELECT * FROM tableA 
    inner join tableB on tableA.term_id = tableB.term_id 
    inner join tableC on tableA.term_id = tableC.term_id;
    

    It an example you can modify as per your need.


    Edit 2

    SELECT * FROM  tableB 
    JOIN tableA AS tableA1 ON tableB.term_id = tableA1.a_term_id
    JOIN tableA AS tableA2 ON tableB.term_id = tableA2.b_term_id
    JOIN tableA AS tableA3 ON tableB.term_id = tableA3.c_term_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm executing a query like this select field from table; In that query, there
I've got a table where all fields are set to 'utf8_general_ci'. There's a trigger
I have a table with three fields, FirstName, LastName and Email. Here's some dummy
I have a table with three fields, User , City and Country , where
is there a standard or best practice with database table names and fields in
Is there any way to to list out the fields present in a table
Is there any way to get available values for SET field in table? Thank
Consider i have a registartion table and there is field prefLocationId and it contains
There is a field in my company's Contacts table. In that table, there is
Is there any possibility of changing the MySQL DB table's field name or adding

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.