Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding duplicate not working
Message
De
10/11/2003 11:50:00
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00848361
Message ID:
00848371
Vues:
15
I think you have to my fields in the GROUP BY clause.
Try this:
SELECT p_ssn, COUNT(*) AS ssncount ;
FROM prodti ;
GROUP BY p_ssn ;
HAVING ssncount > 1


>I have 3 fields in my view:
>
>
>SSN, Name, Amt
>
>
>I am trying to find duplicate SSN but my query keeps returning none. I have tried the following but to no avail, it doesn't return any rows:
>
>
>SELECT MAX(Prodti.p_name), MAX(Prodti.p_amt), COUNT(Prodti.p_ssn);
> FROM ;
>     ti!prodti;
> GROUP BY Prodti.p_ssn, Prodti.p_name, Prodti.p_amt;
> HAVING  COUNT(Prodti.p_ssn) > ( 1 );
> ORDER BY Prodti.p_ssn
>
>
>and also
>
>
>SELECT MAX(Prodti.p_name), MAX(Prodti.p_amt), Prodti.p_ssn, count(*);
> FROM ;
>     ti!prodti;
> GROUP BY Prodti.p_ssn, Prodti.p_name, Prodti.p_amt;
> HAVING  count(*) > ( 1 );
> ORDER BY Prodti.p_ssn
>
>
>Can someone tell me what I am missing here. I am using VFP8 by the way.
>
>Thanks
>Nick Patel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform