Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql statement
Message
De
15/01/2002 18:24:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/01/2002 08:00:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00604780
Message ID:
00605157
Vues:
28
>Hi all,
>
>I have a table named company. as i forget to set primary key in the table
>i find the table have records like this:
>co_id co_ref1 co_ref2 co_ref3
>c1 peter john
>c1 john mary
>
>Now i want to set the co_id as primary key but the key fields have records
>with same key value. I want to write a sql to combine the above 2 records as:
>
>c1 peter john mary
>
>I have tried some sql statement but cannot do it. Can someone please tell
>me how? thx.
>
>Linda

Linda,

You should use HTML tags < PRE > and < /PRE > (without the spaces) to keep allingment.

To combine records, you would usually use SELECT ... GROUP BY; however, I see no way of doing this with a single SELECT command.

You can, however, call a UDF() from the GROUP BY clause. You can also use a traditional SCAN to loop through all the records.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform