Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Duplicate Rows
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01321346
Message ID:
01321352
Vues:
22
>Sorry, I should have clarified that.
>
>If the Title, Table and Field combination appears more than once, then it's a duplicate.
>
>

Do you have an ID in that table?
select Min(ID) as ID, Title, Table, Field, cnt(*) as Cnt_Dups ;
from myTable group by 2,3,4 having Cnt_Dups > 1 into cursor curDups

delete from MyTable myTable join curDups on myTable.Title = curDups.Title etc. where myTable.ID <> curDups.ID && verify the syntax here
>
>>What is the definition of a duplicate here?
>>
>>>I have a table with this structure:
>>>
>>>
>>>Sec Tp Title                         Table      Field
>>>---------------------------------------------------------
>>>    CR cash balance between 300.rpt  trades     tradedate
>>>    CR cash balance between 300.rpt  trades     valuedate
>>>    CR cash balance between 300.rpt  cust       acctname
>>>    CR cash balance between 300.rpt  trades     conf_num
>>>    CR cash balance between 300.rpt  trades     product
>>>    CR cash balance between 300.rpt  trades     quantity
>>>    CR cash balance between 300.rpt  trades     price
>>>    CR cash balance between 300.rpt  trades     ext_price
>>>    CR cash balance between 300.rpt  trades     productbal
>>>    CR cash balance between 300.rpt  trades     cash_bal
>>>3.1 CR invoice prior posting.rpt     trades     product
>>>3.1 CR invoice prior posting.rpt     trades     quantity
>>>3.1 CR invoice prior posting.rpt     tranfile   tranquant
>>>3.1 CR invoice prior posting.rpt     prods      prodesc
>>>3.1 CR invoice prior posting.rpt     trades     price
>>>3.2 CR open customer positions.rpt   trades     tradedate
>>>3.2 CR open customer positions.rpt   trades     tradetype
>>>3.2 CR open customer positions.rpt   trades     product
>>>3.2 CR open customer positions.rpt   trades     quantity
>>>3.2 CR open customer positions.rpt   trades     price
>>>3.2 CR open customer positions.rpt   trades     net_amount
>>>3.2 CR open customer positions.rpt   trades     cash_bal
>>>3.2 CR open customer positions.rpt   trades     conf_num
>>>3.2 CR open customer positions.rpt   trades     productbal
>>>3.2 CR open customer positions.rpt   trades     valuedate
>>>
>>>
>>>How do I remove the duplicate rows?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform