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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:34:24+00:00 2026-06-09T09:34:24+00:00

I have 3 tables: Table1, Table2, Table3 I want to make a query that

  • 0

I have 3 tables: Table1, Table2, Table3

I want to make a query that use Table1’s result as Table2’s constrain, Table2’s result as Table3’s constrain

so my query now is something like:

SELECT tb3.id 
FROM tb3 
WHERE tb3.tag = (
                   SELECT tb2.num 
                   FROM tb2 
                   WHERE tb2.name = (
                                      SELECT tb1.user 
                                      FROM tb1 
                                      WHERE check = '0'
                                    )
                 )

for example,

tb1 has item ‘tb1.check’, ‘tb1.user’;

tb2 has item ‘tb2.num’, ‘tb2.name’;

tb3 has item ‘tb3.tag’, ‘tb3.id’;

first check tb1 for data where ‘tb1.check’= 0 , then get its ‘tb1.user’,

then check tb2 for data where ‘tb2.name’ = ‘tb1.user’ and get ‘tb2.num’,

and so, check tb3 for data where ‘tb3.tag’ = ‘tb2.num’ then get ‘tb3.id’

but all I get is empty, any help?

  • 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-09T09:34:26+00:00Added an answer on June 9, 2026 at 9:34 am

    use INNER JOIN instead of subquery as:

    SELECT tb3.id 
    FROM tb3 
         INNER JOIN tb2  
             ON tb3.tag = tb2.num
         INNER JOIN Invitation inv
             ON tb2.name = inv.user AND
                inv.check = 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 tables, and I want to make a query for a search
I have two tables that I want to join together. Table1 Year, ID, Theme,
Hy all, I want an idea from you.I have 2 tables.From table1 I want
I have a table : tags(tagname,entryid,stamp) and i want to make a section for
I have a table A with a date field. I want to make a
I have a table with primary key (ColumnA, ColumnB). I want to make a
Question: I have to create a tablet application. In this i want to make
I want to make an hibernate querycount on a table. I have to values,
I have a database with three tables: user_table country_table city_table I want to write
I have two tables Loan(Parent Table) and Receipt(Child table)what i want to do is

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.