Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding duplicate not working
Message
From
10/11/2003 11:50:00
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00848361
Message ID:
00848371
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform