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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:31:34+00:00 2026-06-16T03:31:34+00:00

I have two mysql tables: a. myTable1 and b. myTable2 First, I need to

  • 0

I have two mysql tables: a. myTable1 and b. myTable2

First, I need to query the first table (myTable1) to get ‘custid’ and ‘age’ and then query the second table (myTable2) to get all the records that match any of the records in the intermediate result.

First query and the result look like as below:

select distinct custid,age from mtyTable1 where itemid in ( 2762 , 2763)

custid      age
"8897953"   53.1839
"1433515"   49.5507
"7638023"   59.4099
"2310899"   46.8374
"6736604"   47.3001

Now, How to write an efficient nested query to search ‘myTable2’ to find all the records?

  • 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-16T03:31:35+00:00Added an answer on June 16, 2026 at 3:31 am

    Try :

    SELECT DISTINCT t2.*
    FROM mtyTable1 t1 INNER JOIN Table2 t2 ON t1.custid=t2.custid AND t1.age=t2.age
    WHERE t1.itemid IN ( 2762 , 2763)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two mysql tables, courses and student_courses, I need to get unique course_names
Currently, I have two MySQL tables. First table stores relation between the friend and
Currently, I have two MySQL tables. First table stores relation between the friend and
I have two MySQL tables, j and t, with a third normalising table, jt.
I have two MySQL tables named 'nodes' and 'joinTable' like shown below. I need
I have two MySql tables as shown below with the data shown: CREATE TABLE
I have two MySql tables, once for Locations and one for Images. I need
Ok, I have two MYSQL tables: CREATE TABLE `sessions` ( `id` int(11) NOT NULL
I have two MySQL tables A and B . Table A has a member
i have two mysql tables. the first is called chosen and consists of id,

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.