Bonjour tout l'monde, donc voilà ma requête de base :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
select LIBELLECAUSE, count(*) as TOTAL 
from CAUSECH22010, CAUSECH2 
where CAUSECH22010.CAUSE = CAUSECH2.CAUSECH2 
and DATEHEURE between '01-01-2010' and '31-01-2010' 
group by LIBELLECAUSE
Cette requête fonctionne, mais maintenant je souhaiterai rajouter un ORDER BY sur le TOTAL, or ceci ne marche pas :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
select LIBELLECAUSE, count(*) as TOTAL 
from CAUSECH22010, CAUSECH2 
where CAUSECH22010.CAUSE = CAUSECH2.CAUSECH2 
and DATEHEURE between '01-01-2010' and '31-01-2010' 
group by LIBELLECAUSE
order by TOTAL
J'ai le message " TOTAL column unknow" je ne vois pas comment faire pour trier cette requête.
Je précise aussi je suis sur interbase 6 (je suis en stage en ce moment).