Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL duplicates Question
Message
De
22/09/2012 16:29:27
 
 
À
22/09/2012 15:42:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01553489
Message ID:
01553491
Vues:
66
*USE (m.TableToSave) && Not necessary, the SQL statement opens the table automatically
SELECT field1, field2 FROM (m.TableToSave) GROUP BY field1, field2 having count(*)>1 INTO cursor sqltemp && You must list every field!!
SET SAFETY OFF
*CLOSE TABLES ALL && Not necessary
Select * from sqltemp into table (m.tableToSave)
CLOSE TABLES ALL
>The SQL below crashes on the 'GROUP BY' line but still runs through to a BROWSE statement below the SQL.
>Duplicates are not removed in the result. When I close the BROWSE window, the GROUP BY line is highlighted.
>
>* Remove dupicates
>USE (m.TableToSave)
>SELECT * FROM (m.TableToSave)
>GROUP BY hits
>INTO TABLE sqltemp
>SET SAFETY OFF
>CLOSE TABLES ALL
>COPY FILE sqltemp.DBF TO (m.TableToSave)
>CLOSE TABLES ALL
>
>What have I missed?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform