Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/02/2009, 09:15
jurena
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Cáceres
Mensajes: 3.735
Antigüedad: 16 años, 1 mes
Puntos: 300
Respuesta: ordenar y luego agrupar

Prueba esta:

Código sql:
Ver original
  1. SELECT facturas.id, facturas.num_factura, facturas.fecha
  2. FROM facturas
  3. INNER JOIN (
  4.  
  5. SELECT MAX( fecha ) FECH, num_factura
  6. FROM facturas
  7. GROUP BY num_factura
  8. )t1 ON t1.num_factura = facturas.num_factura
  9. AND t1.FECH = facturas.fecha
  10. ORDER BY facturas.fecha DESC