Ver Mensaje Individual
  #2  
Antiguo 09-12-2009
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.293
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Supongo que en lugar de esto:

Código SQL [-]
select max(b.campo1) from Tabla b 
     where b.id_articulo = a.id_articulo

podrías hacer algo así:

Código SQL [-]
Select Top 1 b.campo1, b.campo2 from Tabla b
inner join a
onb.id_articulo = a.id_articulo 
order by b.campo1 desc

Aunque no me queda claro a dónde quieres ir a parar....
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita