Oh my god it work.Thank you very much Felix (thanks all for answer). I don't
have knowlege in MySql. Thanks thanks thanks. I have one more select (the
last), if you can help me with this please.

SELECT * FROM login_users WHERE id IN (SELECT o.user_id from orders
o,facturas f where factura_id='".$order."' AND o.orders_id=f.pedido);

Thanks all,
Tomás
-----Mensaje original-----
De: Felix Geerinckx [mailto:[EMAIL PROTECTED] 
Enviado el: jueves, 11 de enero de 2007 19:25
Para: mysql@lists.mysql.com
Asunto: Re: Need any that can translate this

[EMAIL PROTECTED] (Tomás Abad Fernández) wrote in
news:[EMAIL PROTECTED]: 

> I dont know why thease don't work at MySql 3.21 , anyone can help me 
> to make this compatible with mysql3?

3.21 is really ancient ...
>  
> $query = "SELECT * FROM facturas WHERE pedido IN (SELECT orders_id 
> FROM orders WHERE user_id='".$user."') ORDER BY factura_id";

... don't even know if this will work:

SELECT DISTINCT
    f.*
FROM facturas f, orders o
WHERE 
    f.pedido = o.orders_id AND
    o.user_id = '$user'
ORDER BY f.factura_id;

--
felix

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to