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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested query In MYSQL

Status
Not open for further replies.

Haai

Programmer
Aug 16, 2007
1
ZA
how can write a mysql query for nested query.
ex:
select Student.NAME from Student where Student.NAME = (select Citizen.NAME from Citizen where Citizen.NAME="boy");

o/p string for this query is:
ERROR 1064: You have an error in your SQL syntax near 'select Citizen.NAME from Citizen where Citizen.NAME="boy' at line 1
 

hi, nested selects aren't supported yet.

you could create a temporary table with the inner select, or the following should work:

select Student.NAME from Student,Citizen where Student.NAME =Citizen.NAME and Citizen.NAME="boy"


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top