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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:59:39+00:00 2026-06-03T23:59:39+00:00

we have three tables. tblA id(PK) doc_id(fk) mr_id(fk) date ——– ———- ——– ——— 1

  • 0

we have three tables.

tblA

id(PK)      doc_id(fk)     mr_id(fk)       date 
--------    ----------     --------        ---------
1             23            22             2012-05-23
2             24            22             2012-05-23
3             25            21             2012-05-24
4             26            22             2012-05-24



tblB 

doc_id(PK)      d_name          d_segId(FK)    mr_id(FK)  
------------    -------------   ----------     ---------- 
     1          manish           1              12
     23         rahul            2              22
     24         paul             1              22
     25         jacky            1              21
     26         amit             2              22



tblC
seg_id(PK)      seg_name       seg_color        
--------        ----------     --------       
1               A_corei         red             
2               Bcorec          green          

what i want is all the record from tblA where mr_id=22 and date=’2012-05-23′ and order by seg_name in tblC

doc_id is referenced to tblB and
on the basis of doc_id, Seg_id is referenced to tblC how to use join in this situation.

It should look like

id           doc_id      d_name        seg_color
--------    ---------   ---------      ----------
1            23          rahul         green  
2            24          paul          red
  • 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-03T23:59:40+00:00Added an answer on June 3, 2026 at 11:59 pm
    SELECT
        tblA.id,
        tblA.doc_id,
        tblB.d_name,
        tblC.seg_color
    FROM
        tblA, tblB, tblC
    WHERE
        tblA.doc_id = tblB.doc_id
        AND
        tblB.d_segId = tblC.seg_id
        AND
        tblA.mr_id = 22
        AND
        tblA.date = '2012-05-23'
    ORDER BY
        tblC.seg_name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following 3 tables: tblA ID - PK name tblB ID -
Let's say I've got two tables, tblA and tblB , that have a 1:n
I have three tables: Employee(Id,name etc) Appointment(Id,date,time,employee id, clientid etc) Client(Id,name etc) The Employee
I have three tables: user(id, name); tasks(id, user_id, text, date); bonus(id, user_id, sum, date,
I have three tables table1, table2, table3 with col1, col2 and identity ID column.
I have three tables: Account , Management , and ManagementAccountLookup . The Account table
I have three tables: categories, articles, and article_events, with the following structure categories: id,
I have three tables: Table 1 - Members Id Name 1 Member1 2 Member2
I have three tables A, B and A_B (with the @ManyToMany annotation). I tried
I have three tables : ImportBatch PatientChartImages PatientChartBatchMapping (this table has foreign key to

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.