Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error correlating fields
Message
De
26/01/2012 05:30:21
 
 
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 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01533734
Message ID:
01533788
Vues:
39
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I'm getting the title's error on this SQL
>
>
>SELECT V.*,1 as DupType FROM csrVendors V ;
>INNER JOIN (select MIN(ID) as MinID, UPPER(full_name) as Full_Name FROM csrVendors GROUP BY 2 HAVING COUNT(*) > 1) Dups ;
>ON UPPER(V.full_name) = Dups.full_name AND V.ID > Dups.MinID ;
>UNION ;
>SELECT V.*, 2 as DupType FROM csrVendors V WHERE exists (SELECT full_name FROM i_vendor VV ;
>WHERE UPPER(VV.full_name) = UPPER(V.full_name)) ;
>INTO CURSOR csrVendorDups NOFILTER
>
>Do you see what may be wrong here?
>
>Thanks in advance.

try
...
 WHERE UPPER(V.full_name) IN (SELECT  UPPER(VV.full_name)  FROM i_vendor VV );
....
if UPPER(VV.full_name) is an unique field you can uses INNER JOIN.

EXISTS() is equal to IN () ,
NOT EXISTS() is not equal to NOT IN ()
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform