
07/11/2007, 13:45
|
 | Colaborador | | Fecha de Ingreso: diciembre-2004
Mensajes: 1.802
Antigüedad: 20 años, 2 meses Puntos: 38 | |
Re: Obtener registros unicos
Código:
Select Id_CABEC
,min(Id_ITEM) -- Selecciona el minimo Id
,Id_SHOP
,Nombre
,Apellido
,Tel
From MiTabla
Group by
Id_CABEC
,Id_SHOP
,Nombre
,Apellido
,Tel
Having count(1) > 1 -- En caso de que en la tabla halla registros no repetidos
__________________ La sencillez y naturalidad son el supremo y último fin de la cultura...
--
MCTS : SQL Server 2008, .NET Framework 3.5, ASP.NET Applications. |