Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Improve a table with repeated names
Message
De
03/07/2003 08:18:41
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00806453
Message ID:
00806487
Vues:
20
This message has been marked as the solution to the initial question of the thread.
Hi Moises;

to get to new tables out of the original:
SELECT DISTINCT;
Cur1.Field1 AS cName;
FROM Original_Table AS Cur1;
INTO TABLE tabNames

SELECT;
Cur1.Field2,;
Cur1.Field3,;
Cur1.Field4;
FROM Original_Table AS Cur1;
INTO TABLE tabWithOutNames
as I understand your inital question you would like to use the first result as a kind of preselect the second one.
This will only work if they have something common ( Field1? ). So you need field1 in the second table.
SELECT;
Cur1.Field1,;
Cur1.Field2,;
Cur1.Field3,;
Cur1.Field4;
FROM Original_Table AS Cur1;
INTO TABLE tabWithOutNames

SET INDEX TO Field1 TAG _Field1

SELECT DISTINCT;
Cur1.Field1 AS cName;
FROM Original_Table AS Cur1;
INTO TABLE tabNames

SET RELATION TO cName INTO tabWithOutNames
HTH
Agnes

>Thank you Caroline
>But I think I mistyped my question
>
>I need sql command to create 2 new tables from my table
>
>I have a table with struct (4 fields)
>
> Name(field1)
> Field2
> Field3
> Field4
>
> I have many repated names (field1)
>
> Carl
> John
> Carl
> Moses
> Carl
> Etc.
>
>
> I need I new table for name (without repeat names)
>and I new table for field1, field2 and field3
>
>Moses
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform