Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CountDistinct in SQL Server
Message
 
 
À
01/04/2008 11:41:43
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01307343
Message ID:
01307377
Vues:
9
>>
>>SELECT  tlp.PersonID, tlp.Program,
>>		( SELECT COUNT(*) FROM dbo.tmmLicesnses2Persons tlp2
>>			WHERE tlp2.Program = tlp.Program
>>				AND (DateActivated IS NOT NULL) AND (DateDeactivated IS NULL)) AS ProgramCount
>>	FROM   dbo.tmmLicesnses2Persons tlp
>>	WHERE (DateActivated IS NOT NULL) AND (DateDeactivated IS NULL)
>>	GROUP BY PersonID, Program
>>
>This is the solution I was looking for, simple and correct. I have actually done this before, but could not wrap my mind around it this morning. Thank you Sergey!

You're welcome. :)
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform