Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL to check for dupes
Message
De
29/10/2014 13:23:06
 
 
À
22/06/2014 14:31:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01602195
Message ID:
01610119
Vues:
33
Antonio,

I can't tell you how many times I've used your nifty little SQL. Thanks again!

Yossi

>You should have a primary key somewhere out there, it would allow for a much more elegant and cleaner SQL...
>
>
>SELECT itemnum, location, RECNO() as recnum ;
>  FROM curLoc ;
>  WHERE (location + TRANSFORM(itemnum)) IN ;
>    (SELECT (location + TRANSFORM(itemnum)) FROM curloc GROUP BY itemnum, location HAVING COUNT(*) > 1) ;
>  INTO CURSOR curDup
>
>
>>Hi All:
>>
>>I can't figure out the SQL needed for this problem. There cannot be 2 records with the same location. Therefore Item# 6677 is invalid:
>>
>>
>>Item#      Location
>>1234       LOC1
>>2345       LOC1
>>2345       LOC2
>>6677       LOC1
>>6677       LOC1
>>
>>
>>I need the SQL to generate the following cursor, containing all the invalid records, appending the recno():
>>
>>
>>Item#   Location   Recno
>>6677    LOC1       43
>>6677    LOC1       78
>>
>>
>>Thanks,
>>
>>Yossi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform