Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By simple?
Message
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:
00637979
Vues:
19
>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.

select field1, min(field2) as Field2 from yourTable group by 1
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform