Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Yes, that SQL statement is invalid. You are grouping by one column, but VFP says it cannot make that grouping because it will not know which value of other columns to show if there is more than one value in a column which must be "collapsed" by the group by.
For example, let's say you have 2 rows like this:
row 1: Val1 = xx, val2 = yy
row 2: val1 = xx, val2 = zz
Then you issue: select val1, val2 group by val1.
If VFP tried to group rows 1 and 2, which value would it show for val2? It would not know which one to show; therefore, VFP declares the group by clause to be invalid.
This behavior is by design ever since (I think) VFP 8.0.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement