nested query

Problems with the Windows version of XAMPP, questions, comments, and anything related.

nested query

Postby pplastiras » 02. July 2011 08:42

hi, i have a problem with a nested query i'm trying to create. the query code is:

Code: Select all
SELECT pc.pc_id, pc.pc_no, pc.pc_net, pc.pc_loc, pc.pc_name,
sw.swtch_id, sw.swtch_model, sw.swtch_rack, sw.swtch_loc,
conn.swtchconn_swtchid, conn.swtchconn_pcid, conn.swtchconn_portno
FROM pcs AS pc, switches AS sw, swtchconn AS con,
WHERE
con.swtchconn_pcid IN (SELECT pc_id, pc_no FROM pcs WHERE pc_id='11' || pc_loc='0' || pc_net='0' HAVING pc_no!=1) &&
con.swtchconn_swtchid IN (SELECT swtch_id, swtch_no FROM switches WHERE swtch_id='0' || swtch_rack='2' || swtch_loc='0' HAVING swtch_no!=1)


and the error message i get back is:

Error Code : 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE

con.swtchconn_pcid IN (SELECT pc_id, pc_no FROM pcs WHERE pc_id='11' || ' at line 9


I have read that maybe the falt is the mysql version but i think i'm working on mysql 5.1 so nasted queries are supported. can anyone help me!!!!!
pplastiras
 
Posts: 6
Joined: 24. June 2011 16:32

Re: nested query

Postby Sharley » 02. July 2011 08:48

pplastiras wrote:but i think i'm working on mysql 5.1
The readme_en.txt file in the xampp folder will give you some certainty about which version of MySQL you are working with.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: nested query

Postby pplastiras » 02. July 2011 10:09

Yes my mysql is 5.1, so nested queries must be supported. have you got an idea about what is going wrong?
pplastiras
 
Posts: 6
Joined: 24. June 2011 16:32


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 150 guests