
25/09/2007, 17:52
|
| | Fecha de Ingreso: septiembre-2007
Mensajes: 19
Antigüedad: 17 años, 6 meses Puntos: 0 | |
Re: 3 mejores clientes por año la respuesta es
SELECT cliente, total, año
FROM TOTALES AS CTE
WHERE 3 > (
SELECT count( * )
FROM TOTALES
WHERE año = CTE.año
AND total > CTE.total )
ORDER BY año DESC , total DESC |