Ver Mensaje Individual
  #2 (permalink)  
Antiguo 10/02/2010, 09:28
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: ayuda! obetener top10 de tablas relacionadas

Intenta asi:
Código SQL:
Ver original
  1. SELECT TOP 10 COUNT(Venta) [CONTEO_VENTAS], T1.RFC, T1.NOMBRE
  2. FROM [Tabla 1] T1
  3. INNER JOIN [Tabla 2] T2 ON T1.RFC = T2.RFC
  4. GROUP BY T1.RFC, T1.NOMBRE
  5. ORDER BY COUNT(Venta) DESC
__________________
No repitamos temas, usemos el Motor de busquedas
Plantea bien tu problema: Ayúdanos a ayudarte.