![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
15/02/2013, 13:41
|
![Avatar de Libras](http://static.forosdelweb.com/customavatars/avatar147802_5.gif) | Colaborador | | Fecha de Ingreso: agosto-2006 Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 6 meses Puntos: 774 | |
Respuesta: elegir solo el primer registro pues cambialo...
SELECT * FROM (
SELECT row_number() over(partition BY id_tar ORDER BY id_tar) AS rn, campo1,campo2,campo3 FROM tabla) t1 WHERE rn=1
__________________ What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me |