Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By simple?
Message
De
27/03/2002 13:02:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00637968
Message ID:
00637976
Vues:
18
>Hi could someone clarify for me if its possible to control the Group By clause of a select statement (ordering doesn't seem to alter the results.
>
>If my select produced:
>
>Field1 Field2
>  1      a
>  1      b
>  2      b
>  2      a
>
>After a group by on Field1 how can I get the result to be:
>
>Field1 Field2
>  1      a
>  2      a
>
>Thanks in anticipation.

Caroline,
What logic outputs like that ? Is that sort on first col then on 2nd ? If so 'simple' group by needs 2 SQL :

select * from mySource order by 1, 2 desc into cursor crsTemp nofilter
select * from crsTemp group by 1

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