
19/12/2006, 02:04
|
 | | | Fecha de Ingreso: octubre-2004 Ubicación: Madrid
Mensajes: 334
Antigüedad: 20 años, 4 meses Puntos: 2 | |
Re: Ayuda con MySql - Where Min Prueba con una subconsulta en el where algo como esto
Código:
SELECT
min(t.pos) as m ,
t.pos,
l.id,
l.shortaddress,
l.price,
t.title,
t.src,
t.thumb,
t.type,
l.caption,
l.msl,
r.state
FROM
realtorlisting r,
listing l,
tours t
WHERE
l.id =r.id_listing AND
l.id=t.id_listing AND
r.id_reltor=$valor AND
l.status=0 AND
campo_en_cuestion = (SELECT MIN(pos) FROM tours)
GROUP BY t.id_listing
ORDER BY t.id_listing desc
Un saludo |