Re: Re: pb with 'Order by'
Posted in 1995
In your previous answer, your answered : > That is because your group by contains more columns that your order by clause. > What you are trying to do is order within the group. Is that what you want? > If not, have your order by contain the same columns (or more) than your group > by. I tested this Select as you proposed me, but unfortunately the problem is the same: The order is always wrong. select cce_numcde,cce_solde,cce_datecde,adr_raison,cce_cptgal,cce_cptaux,sum(ccl_total) sstotal from ccentete,ccligne,adresses where cce_numcde=ccl_numcde and cce_cptgal=adr_cptgal and cce_cptaux=adr_code and cce_datecde>="01/01/95" and cce_datecde<="28/02/95" and cce_solde="N" group by cce_cptgal,cce_cptaux,cce_numcde,cce_solde,cce_datecde,adr_raison order by cce_cptgal,cce_cptaux,cce_numcde,cce_solde,cce_datecde,adr_raison cce_numcde cce_cptgal cce_cptaux 952400003.0 N 08/02/95 ALPLOG 401000 ALPLOG 8575.0 952400004.0 N 08/02/95 SUN MICROSYSTEMS FRANCE S.A 401000 SUN69MAT 719653.0 952400005.0 N 08/02/95 SUN-EXPRESS EUROPE 401000 SUNEXPRES 78047.0 952400009.0 N 09/02/95 SUN MICROSYSTEMS FRANCE S.A 401000 SUN69MAT 396536.0 952400012.0 N 09/02/95 VITEK 401000 VITEK 18140.0 952400016.0 N 09/02/95 ISTA 401000 ISTA 1575.0 952400021.0 N 09/02/95 VITEK 401000 VITEK 9000.0 952400024.0 N 10/02/95 LOCAMESURE S.A 401000 HAMILTON 7430.0 952400025.0 N 10/02/95 LOCAMESURE S.A 401000 HAMILTON 19358.0 952400034.0 N 13/02/95 ECTRA 401000 ECTRA 1103.2 952400035.0 N 13/02/95 ECTRA 401000 ECTRA 1422.0 952400040.0 N 14/02/95 VITEK 401000 VITEK 7650.0 952400048.0 N 14/02/95 AIF SERVICES S.A 401000 AIF 2010.0 952400049.0 N 14/02/95 FABRE MESURELEC S.A 401000 FABREMESU 2133.0 952400050.0 N 14/02/95 GS TECHNOLOGIE TT 401000 GST 6742.5 952400052.0 N 14/02/95 ALMA 401000 ALMA 1840.0 952400053.0 N 14/02/95 ACCENT MONDIAL 401000 ACCENTMON 180.0 952400057.0 N 14/02/95 FINELY 401000 FINELY 16000.0 952400059.0 N 15/02/95 COMITE NATIONAL FRANCAIS 401000 CIGRE 2770.0 952400065.0 N 17/02/95 THOMSON TRAINING 401000 THOMSON 435946.0 952400081.0 N 22/02/95 DOM ALPES 401000 DOM 192.0 952400091.0 N 28/02/95 PIXEL SYSTEMS 401000 PIXELSYST 23485.96 952400093.0 N 28/02/95 ECTRA 401000 ECTRA 843.0 Have you another idea ? Thanks Lionel -------------------------------------------------------------------------- U.S.A. | AppleLink : ASCUS About Software Corporation | eWorld : ASC.US 10601, South De Anza Blvd. |America Online : ASCUS Suite 105 | Compuserve : 73243,36 Cupertino, CA 95014 | Internet : info@ascus.com general phone : (408) 725 4242 | Anonymous FTP : ftp.ascus.com sales : (800) 55 SOFTWARE | ARA Server : (408) 725 4250 tech support : (408) 725 4240 |FirstClass BBS : (408) 725 4252 fax : (408) 725 4243 | bbs.ascus.com -------------------------------------------------------------------------- FRANCE | AppleLink : ADV.SOFT ASC | Compuserve : 76034,2123 9551, route de St Laurent du Var | Internet : euro_info@ascus.com F-06610 La Gaude | Anonymous FTP : ftp.ascus.com general phone : +33 93 24 76 00 | ARA Server : +33 93 24 76 03 fax : +33 93 24 76 06 |FirstClass BBS : +33 93 24 76 13 --------------------------------------------------------------------------