MySQL does not support sub-queries. Take a look at JOINS
(http://www.mysql.com/doc/J/O/JOIN.html)

----- Original Message -----
From: "Luis Rodrigues" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 6:03 AM
Subject: Problem with subqueries


hi,
I have some sql code that I need to use with mysql
it uses nested queries and since mysql doesn't implement them
I would like to know how to do this.

SELECT * FROM apartamentos
WHERE vendido=0
AND Concelho=$row["ConcelhoP"]
AND Localidade LIKE '&$row["LocalidadeP"]&' ...

WHERE Referencia NOT IN ( SELECT Referencia FROM historico_clientes WHERE
NumCliente=$id)

Best Regards,

Luis Rodrigues



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to