Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/04/2011, 13:34
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: Problema con instruccion sql

select codigo,texto,conversacion,fecha, identity(int,1,1) row into #temp2 from(
select ROW_NUMBER () OVER ( PARTITION BY conversacion ORDER BY conversacion ASC) AS RN, * from tu_tabla
) t1 where rn=1

select row,texto,conversacion,fecha from #temp2


Prueba algo asi, y temp es la tabla que use para obtener los registros tal y como los muestras. saludos!
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me