Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/02/2012, 15:31
Avatar de flaviovich
flaviovich
 
Fecha de Ingreso: agosto-2005
Ubicación: Lima, Peru
Mensajes: 2.951
Antigüedad: 18 años, 8 meses
Puntos: 39
Respuesta: 2 consultas SQL en una - mayor velocidad

Código SQL:
Ver original
  1. SELECT DISTINCT f.Factura_Numero
  2. FROM Tabla_Facturas f
  3. LEFT JOIN Tabla_Facturas f2 ON f.Factura_Codigo_Cliente=f2.Factura_Codigo_Cliente
  4.     AND NOT f.Factura_Numero=f2.Factura_Numero AND f.orderid<f2.orderid
  5. WHERE f2.Factura_Numero IS NOT NULL
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.