Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CountDistinct in SQL Server
Message
De
01/04/2008 11:33:43
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01307343
Message ID:
01307362
Vues:
8
>>Well, here is the exact code, and it includes ItemB (program), which seems to through things off.
>>
>>
>>SELECT     PersonID, Program, COUNT(DISTINCT Program) AS ProgramCount
>>FROM         dbo.tmmLicesnses2Persons
>>WHERE     (DateActivated IS NOT NULL) AND (DateDeactivated IS NULL)
>>GROUP BY PersonID, Program
>>
>
>
>SELECT     PersonID, Program, COUNT(*) AS ProgramCount
>FROM         dbo.tmmLicesnses2Persons
>WHERE     (DateActivated IS NOT NULL) AND (DateDeactivated IS NULL)
>GROUP BY PersonID, Program
>
By the way, thank you for your help! :)
Thank You

Rollin Burr

Politicians and diapers have one thing in common. They should both be changed regularly, and for the same reason.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform