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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:35:36+00:00 2026-06-17T12:35:36+00:00

I have the following 3 data tables Options Table UID (pk) SID (pk) TID

  • 0

I have the following 3 data tables

Options Table
UID (pk) SID (pk) TID (pk)
--------------------------
1        20       2
1        20       3
1        13       3
1        14       4

Types Table
TID (pk) TText
--------------------------
1        Text 1
2        Text 2
3        Text 3
4        Text 4

Sets Table
SID (pk)  SText
--------------------------
13        Set 13
14        Set 14
20        Set 20

I am trying to get the output as follows, with only 4 rows from the options table, but with the corresponding text from the other 2 tables. My joins seems to be off tho.

The result I want is:

UID (pk) SID (pk) TID (pk)  SText      TText
------------------------------------------------------
1        20       2         Set 20     Text 2
1        20       3         Set 20     Text 3
1        13       3         Set 13     Text 3
1        14       4         Set 14     Text 4
  • 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-17T12:35:37+00:00Added an answer on June 17, 2026 at 12:35 pm
    SELECT  a.*, b.Stext, c.TText
    FROM    Options a
            INNER JOIN Sets b
                ON a.SID = b.SID
            INNER JOIN  Types c
                ON a.TID = c.TID
    
    • SQLFiddle Demo

    UPDATE 1

    add DISTINCT

    SELECT  DISTINCT a.*, b.Stext, c.TText
    FROM    Options a
            INNER JOIN Sets b
                ON a.SID = b.SID
            INNER JOIN  Types c
                ON a.TID = c.TID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with the following (simplified) structures: table "Factors" which holds data
I have following data in my table. alt text http://img26.imageshack.us/img26/3746/productfield.png I want to extract
I have the following data from 2 tables Notes (left) and scans (right) :
1I have the following two tables (sample data) and need to be able to
I have the following sample of data to insert into tables(from parent to child,
I have the following tables: 1) TBL (ID, Data, LastUpdated, DateCreated) 2) TBL_LOG(Log_ID, LogCreateDate,
I have following data in excel table r1 r2 r3 r4 r5 v1 v2
I have the following data on a table tbl Admission : Date and Time
I have two database tables: Definitions table has the following columns: Id, Category Sample
I have the following two tables: foo: ID NUMBER(38) DATA VARCHAR2(10) bar: ID NUMBER(38)

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.