Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with another query
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00707822
Message ID:
00708562
Vues:
17
Thanks for your help.
That almost works, but what i needed is the record count of the select, not the top 1. I finished it up in VFP with SQL pass through.


>Try
select iproductid, caccount, count(caccount) as cnt,
>		( SELECT TOP 1 COUNT(name)
>			FROM customer c2
>			WHERE c2.iproductid = c1.iproductid
>				AND c2.caccount = c2.caccount
>			GROUP BY name ORDER BY COUNT(name) DESC) AS AS namecount
>	from customer c1
>	group by iproductid,caccount
>	having count(caccount)>2
>	order by iproductid,cnt
>
>>Now I want another column that tells me "of those customers using the same credit card, how many have the same last name?"
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform