Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/09/2008, 06:41
Avatar de Andres95
Andres95
Colaborador
 
Fecha de Ingreso: diciembre-2004
Mensajes: 1.802
Antigüedad: 19 años, 5 meses
Puntos: 38
Respuesta: Sentencia SQL

Código:
Select  S.Tienda
         ,max(T.Hora) Hora
          ,S.Cantidad
From    
(Select Tienda, max(Cantidad) Cantidad
From TiendaHoraCantidad
Group by  Tienda)  S
Inner join TiendaHoraCantidad T
On T.Tienda = S.Tienda And T.Cantidad = S.Cantidad
Group by
   S.Tienda, T.Cantidad
Saludos!
__________________
La sencillez y naturalidad son el supremo y último fin de la cultura...
--
MCTS : SQL Server 2008, .NET Framework 3.5, ASP.NET Applications.