Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/02/2013, 09:13
GeriReshef
 
Fecha de Ingreso: julio-2012
Ubicación: Israel
Mensajes: 360
Antigüedad: 11 años, 9 meses
Puntos: 40
Respuesta: Consulta con WHERE y DATEDIFF complejo

Intenta así:
Código SQL:
Ver original
  1. SELECT  *
  2. FROM    (SELECT * ,
  3.                 MIN(LogTime) OVER(Partition BY UserID) MinTime
  4.         FROM    #TEMP) T
  5. WHERE   LogTime=MinTime OR DateDiff(SECOND,MinTime,LogTime)>2;
__________________
El Castellano no es mi lengua materna: discúlpenme por los errores gramaticales.
Mi blog