
26/09/2007, 15:23
|
 | Colaborador | | Fecha de Ingreso: diciembre-2004
Mensajes: 1.802
Antigüedad: 20 años, 2 meses Puntos: 38 | |
Con subquery
Código:
Select Id,
(Select Top 1 Val1
From MiTabla
where Id = T.Id
group by Id, Val1
order by count(1) desc) Val1
From MiTabla T
Group by Id
__________________ La sencillez y naturalidad son el supremo y último fin de la cultura...
--
MCTS : SQL Server 2008, .NET Framework 3.5, ASP.NET Applications. |