use maestros
Select * from CTrabajadores where left(codtaquilla,3)=’512′ order by codtaquilla
Select * FROM (sELECT ROW_NUMBER() over (partition by dni,codtaquilla ORDER BY CODTAQUILLA) as rownumber, * from CpruebaTrabajadores) T
where T.rownumber>1 and left(codtaquilla,3)=’512′ order by codtaquilla