Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COUNT taking too long on network
Message
De
07/01/1999 10:07:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00172498
Message ID:
00173491
Vues:
29
>>>Hi all,
>>>TIA
>>Perry,
>>Sounds like a SQL counting by grouping :select Field1, Field2, Field3, cnt(*) ;
>> from mytable ;
>> group by 1,2,3 ;
>> into array myarray && into cursor myCursor more parctical ?Cetin
>
>Don't you need to precede the group by with the order by? Otherwise the un-ordered results will be inaccurate.
Dan,
As long as "group by" and "order by" order sequences are same you don't need. "Group by" makes an implicit "order by". Including "order by" is needed if you want to override ordering sequence.
select * from mytable ;
  group by field1, field2, field3 ;
  order by field1, field2, field3 
* Is equivalant to 
select * from mytable ;
  group by field1, field2, field3
* In case override needed 
select * from mytable ;
  group by field1, field2, field3 ;
  order by field3, field1, field2
The real problem is to prevent "group by" doing implicit "order by" on sequential (mean each group is contiguous) but not sorted data.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform