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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:23:20+00:00 2026-05-16T05:23:20+00:00

I have 3 tables A, B and C I am doing this :- /*

  • 0

I have 3 tables A, B and C

alt text

I am doing this :-
/* There is no relation between Table A and Table B . Table A is just used to provide values to C.Profile */
1st step ) D <—- Select * from C where Profile=1 // want to give a specific ProID(I have successfully retrieved it from A table)

2nd Step ) Output <— Select B.sname,D.Status from B Left Join D On B.ID=D.ID

so that the output looks like the required output table shown above:-

Can I do this by using a single query? how?

  • 1 1 Answer
  • 2 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-16T05:23:21+00:00Added an answer on May 16, 2026 at 5:23 am

    Do you mean a subquery:

    Select B.DirName,D.Status 
    from B Left Join (
        Select * 
        from C 
        where ProId=1) As D 
    On B.DirID=D.DirID
    

    It is best to use a list of fields rather than *

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables. Those tables have two relation between them. Table 1 *
Lets say that I have three tables, customers, orders and orderDetails. I'm doing this:
I have the field: APP_DATE (smalldatetime) I'm doing this query: INSERT INTO table (TYPE,
I have three tables. Question, Discipline and QuestionHasDiscipline. QuestionHasDiscipline holds the relation between Question
I have 3 tables. Tour Table (optional) Tour Tag Relation Table (optional_tag_rel) Tour Theme
I have a one-to-many relation between Parent and Child table. In the parent object
I have two tables: Contestant and Votes Contestant hasMany Votes I've tried doing a
I have a table view. And I have multiple rows. While doing the reorder
What im doing is I have a dynamic table and creating rows which all
I have the following PHP code doing a very simple select into a table.

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.