- 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!!!!!