Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/10/2016, 08:53
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: Usar el Distinct en una consulta con campos diferentes

Código MySQL:
Ver original
  1. select t1.* from tabla as t1
  2. left join (select max(fecharegistrolog), ticketid from tabla group by ticketid) as t2 on (t1.ticketid=t2.ticketid and t1.fecharegistrolog=t2.fecharegistrolog)

algo como esto
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me