Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Concatenating during a SELECT
Message
De
14/11/2000 14:56:11
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00441758
Message ID:
00441792
Vues:
8
>>>>>>I'm doing a SELECT on a file and for one of the columns I want a list of the distinct (character) values for that field. Is there any nice way of doing this?
>>>>>How do you want the result to look?
>>>>>
>>>>>If you just want that field do
>>>>>
>>>>>select distinct myfield from mytable into cursor cutmp
>>>>
>>>>No, perhaps I wasn't clear. Let's say I have a table that contains customers and items. I want to group it by customer and end up with a file that contains one record per customer where the second field contains a list of the items for that customer.
SELECT DISTINCT Customer + Item AS CustItem ;
>>>   FROM mytable ;
>>>   INTO blah blah blah
>>That won't give me one record per customer.
I don't think this can be done with a single select statement. Please confirm you would like the results to look like the following:
>Field 1         Field 2
>CustomerName1   Item1, Item2, Item3, ... Item n.
>CustomerName2   Item1, Item2, etc.
Yes, that's the idea. I didn't really expect an easy answer but I figured I'd give it a shot.
Elyse Pomerantz
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform