Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL challenge
Message
From
06/03/1998 18:37:47
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00083158
Message ID:
00083159
Views:
19
It can be done with just one SELECT and a user-defined function, but it's an ugly solution. Instead of SELECT, I would go with an old SCAN...ENDSCAN. It's much easier and "readable". Don't try to use SELECT for all problems... :)

Vlad

>I am trying to solve a problem using only SQL in VFP3.0b
>
>I have a table that is has the following structure:
>
>STAFFID
>LANGUAGE
>
>Which represents the languages that a staff member speaks. If a staff member speaks more than one language they have more than one record in the table.
>
>I would like to collapse this into one record for each staff member by putting all the languages that a staff memeber speaks into one field (for formatting purposes in a report). The structure of the new table thus becomes:
>
>STAFFID
>LANGUAGES
>
>The answer obviously uses a self join... but beyond this I am stumped.
>I don't care how many nested Selects or intermediate selects there are.
>
>If anyone has any time, I would greatly appreciate it.
Previous
Reply
Map
View

Click here to load this message in the networking platform