Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL nested selects

Status
Not open for further replies.

blackhead

Programmer
May 19, 2002
3
0
0
CZ
Hi

Please help me with MySQL!

I need to query something like this:

SELECT * FROM a WHERE NOT id IN ( SELECT a FROM c WHERE b = {x} )

While:

A
--------------------
id int (pk)
name char

B
----------------------
id int (pk)
name char

C
--------------------
id int (pk)
a int ref a
b int ref b


and {x} means perviously selected value from B table.

I know I'm not able to query MySQL that way. It doesn't support subselects using IN keyword. But how to solve this query?

Please help me.

Thank you for your further reply!

Bye George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top