Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 8.0 - Select - SQL
Message
De
18/07/2003 17:37:41
 
 
À
18/07/2003 16:49:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00811460
Message ID:
00811702
Vues:
18
>I am not sure I understand your suggestions, could you give me a sample line of code? Thanks for your time.

3 options: Not all applicable in all situations.

ORIGINAL
SELECT name_line1, first_name, last_name FROM accounts ;
WHERE NOT EMPTY(last_name) ;
GROUP BY name_line1 ;
ORDER BY last_name INTO ARRAY aClientNames
ELIMINATE NON-GROUPED FIELDS FROM FIELD LIST
SELECT name_line1 FROM accounts ;
WHERE NOT EMPTY(last_name) ;
GROUP BY name_line1 ;
ORDER BY last_name INTO ARRAY aClientNames
ADD AGGREGATE FUNCTIONS TO NON-GROUPED FIELDS
SELECT name_line1, MAX (first_name), MAX (last_name) FROM accounts ;
WHERE NOT EMPTY(last_name) ;
GROUP BY name_line1 ;
ORDER BY last_name INTO ARRAY aClientNames
ADD NON-GROUPED FIELDS TO GROUP BY CLAUSE
SELECT name_line1, first_name, last_name FROM accounts ;
WHERE NOT EMPTY(last_name) ;
GROUP BY name_line1, first_name, last_name  ;
ORDER BY last_name INTO ARRAY aClientNames
In your example, which, if I understand correctly, only 1 first and last name can possibly be returned with name_line1, this syntax would appear to be redundant. In most cases, it isn't.

HTH,
Jay
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform