2 nested select queries

  • Thread starter shiller via AccessMonster.com
  • Start date
S

shiller via AccessMonster.com

Is it possible to have 2 nested select queries in a select query?

I currently have the following query:

SELECT 1.a,2.b,3.c FROM 1,2,3 WHERE 2.b IN (SELECT 2.b FROM 2 WHERE 2.b_ID =
1.b_ID)

The above statement works well in retrieving the value for 2.b, but now I'm
trying to add a second nested select statement to retrieve the value for 3.c

.... (SELECT 3.c FROM 3 WHERE 3.c_ID = 1.c_ID)
 
K

KARL DEWEY

UNTESTED --
SELECT 1.a,2.b,3.c FROM 1,2,3 WHERE 2.b IN ((SELECT 2.b FROM 2 WHERE 2.b_ID
=1.b_ID), (SELECT 3.c FROM 3 WHERE 3.c_ID = 1.c_ID));
 
S

shiller via AccessMonster.com

I solved the problem, here's the syntax:

SELECT 1.a,2.b,3.c FROM 1,2,3 WHERE 2.b IN (SELECT 2.b FROM 2 WHERE 2.b_ID =
1.b_ID) AND 3.c IN (SELECT 3.c FROM 3 WHERE 3.c_ID = 1.c_ID)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top