bonjour, j'ai un souci avec SQL 2000 concernant des order by avec des cases.

voici une partie du code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
select *...
                                           case when @Sort_1 = 4  then epp.epp_end_date else null end,                    /* #2012#-1 */
            case when @Sort_1= 4  then isnull(prp.PRP_period_number, 0) else 1 end, /* #2012#-1 */ 
            case when @Sort_1 = 1  then isnull(emc.emc_contract_number,'')
                 when @Sort_1 = 2  then isnull(ad.AD_social_security_number,'')
                 when @Sort_1 = 3  then isnull(dep.dep_code,'')      
                 when @Sort_1 = 5  then isnull(ctyt.CTYT_text,'')             /* #2012# */
                 when @Sort_1 = 6  then isnull(AD_postal_routing_address,'')  /* #2012# */
                 when @Sort_1 = 7  then isnull(adk1.ADK_key,'')               /* #2012# */
                 when @Sort_1 = 8  then isnull(ppm.PPM_code,'')               /* #2012# */
                 else isnull(emc.emc_contract_number,'')
            end,
            case when @Sort_2 = 4  then epp.epp_end_date else null end,                    /* #2012#-1 */
            case when @Sort_2 = 4  then isnull(prp.PRP_period_number, 0) else null end, /* #2012#-1 */
            case when @Sort_2 = 1  then isnull(emc.emc_contract_number,'')
                 when @Sort_2 = 2  then isnull(ad.AD_social_security_number,'')
                 when @Sort_2 = 3  then isnull(dep.dep_code,'')      
                 when @Sort_2 = 5  then isnull(ctyt.CTYT_text,'')             /* #2012# */
                 when @Sort_2 = 6  then isnull(AD_postal_routing_address,'')  /* #2012# */
                 when @Sort_2 = 7  then isnull(adk1.ADK_key,'')               /* #2012# */
                 when @Sort_2 = 8  then isnull(ppm.PPM_code,'')               /* #2012# */
                 else null
            end/*,
J'ai un problème sur les case avec epp.epp_end_date de type date et prp.PRP_period_number de type int. lorsque je répète ces champ dans l'order by j'ai ce message d'erreur.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
A column has been specified more than once in the order by list. Columns in the order by list must be unique.
Si je mets ces champs en commentaire il n'y a aucun souci.
Comment puis-je donc résoudre ce problème.

Merci