Ver Mensaje Individual
  #1  
Antiguo 10-03-2022
Avatar de Angel.Matilla
Angel.Matilla Angel.Matilla is offline
Miembro
 
Registrado: ene 2007
Posts: 1.350
Reputación: 19
Angel.Matilla Va por buen camino
Limitar salida en un SELECT LIST(

Tengo este query:
Código:
SELECT A.Codigo, A.Apellidos, A.Nombre, LIST(B.Fecha)
  FROM Ls01 A
  LEFT JOIN Recibos B ON A.Codigo = B.Codigo
 WHERE A.Codigo = :Codigo
 GROUP BY 1,2,3
Hay casos en los que es LIST tiene muchos registros; por ejemplo:
Cita:
2017-12-01,2018-01-01,2018-02-01,2017-11-22,2020-09-01,2017-06-08,2018-03-01,2017-05-02,2018-01-01,2018-04-02,2019-05-01,2017-02-09,2019-03-04,2020-04-01,2020-06-01,2020-07-01,2019-04-01,2017-03-03,1999-01-04,1999-07-05,1999-10-07,2000-01-05,2000-04-04,2000-07-06,2000-10-04,2001-01-04,2001-04-03,2001-07-03,2001-08-02,2001-09-04,2001-10-02,2001-11-06, etc. (como 35 ó 40 más)
y me gustaría limitar la misma a, pongamos por caso, los 10 últimos por fecha. También me gustaría saber si sería posible que las fechas en las salida las diera en el formato español dd/mm/aaaa.
Responder Con Cita