query with Distinct and count

Hello,

How can I distinct ( v_R_System.Netbios_Name0) in this query without error ?


Select Count(ProdID0) AS 'Count', v_Add_Remove_Programs.DisplayName0, v_Add_Remove_Programs.Publisher0, distinct ( v_R_System.Netbios_Name0)
FROM v_Add_Remove_Programs
JOIN  v_R_System ON v_Add_Remove_Programs.ResourceID = v_R_System.ResourceID
JOIN v_FullCollectionMembership fcm on v_R_System.ResourceID=fcm.ResourceID
WHERE
DisplayName0 not like '%Adobe Flash%' and
DisplayName0 not like '%Adobe%Reader%' and
DisplayName0 not like '%Agent%' and
DisplayName0 not like '%DWG%' and
DisplayName0 not like '%FileZilla%' and
DisplayName0 not like '%ROXIO%' and
DisplayName0 not like '%Java%' and
DisplayName0 not like '%Microsoft Office%' and
DisplayName0 not like '%7-Zip%' and
DisplayName0 not like '%Forefront%' and
DisplayName0 not like '%PDFCreator%' and
DisplayName0 not like '%Framework%' and
DisplayName0 not like '%Informations Personnelles%' and
DisplayName0 not like '%Microsoft Silverlight%' and
DisplayName0 not like '%Java%' and
DisplayName0 not like '%Fingerprint%' and
DisplayName0 not like '%Microsoft Visual%' and
DisplayName0 not like '%HP Quick%' and
DisplayName0 not like '%Microsoft Operations%' and
DisplayName0 not like '%Mise %jour%' and
DisplayName0 not like '%Hotfix%' and
DisplayName0 not like '%Internet Explorer%' and
DisplayName0 not like '%Genuine%' and
DisplayName0 not like '%J2SE%' and
DisplayName0 not like '%MSXML%' and
DisplayName0 not like '%Windows Media%' and
DisplayName0 not like '%Adobe%Player%' and
DisplayName0 not like '%Windows XP%' and
DisplayName0 not like '%Update%' and
DisplayName0 not like '%Broadcom%' and
DisplayName0 not like '%ATI%' and
DisplayName0 not like '%WIMGAPI%' and
DisplayName0 not like '%RDC%' and
DisplayName0 not like '%WebFldrs XP%' and
DisplayName0 not like '%cartes%puce%' and
DisplayName0 not like '%Synaptics Pointing Device Driver%' and
DisplayName0 not like '%.NET Memory Profiler 3.5%' and
DisplayName0 not like '1500%' and
DisplayName0 not like '2400%' and
DisplayName0 not like '3.1.5' and
DisplayName0 not like '32 Bit%' and
DisplayName0 not like 'Correctif%' and
DisplayName0 not like '5300_5400' and
DisplayName0 not like '64 Bit%' and
DisplayName0 not like '6500%' and
DisplayName0 not like '8600%' and
Publisher0 not like '%Hewlett%Packard%' and
Publisher0 not like 'ATI%'

and fcm.CollectionID='SMS00004'
GROUP BY DisplayName0,Publisher0,Netbios_Name0
Order by Count desc

Thanks

bibi
bibi92Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Patrick MatthewsCommented:
Select Count(ProdID0) AS 'Count', v_Add_Remove_Programs.DisplayName0, v_Add_Remove_Programs.Publisher0, v_R_System.Netbios_Name0
FROM v_Add_Remove_Programs
JOIN  v_R_System ON v_Add_Remove_Programs.ResourceID = v_R_System.ResourceID
JOIN v_FullCollectionMembership fcm on v_R_System.ResourceID=fcm.ResourceID
WHERE
DisplayName0 not like '%Adobe Flash%' and
DisplayName0 not like '%Adobe%Reader%' and
DisplayName0 not like '%Agent%' and
DisplayName0 not like '%DWG%' and
DisplayName0 not like '%FileZilla%' and
DisplayName0 not like '%ROXIO%' and
DisplayName0 not like '%Java%' and
DisplayName0 not like '%Microsoft Office%' and
DisplayName0 not like '%7-Zip%' and
DisplayName0 not like '%Forefront%' and
DisplayName0 not like '%PDFCreator%' and
DisplayName0 not like '%Framework%' and
DisplayName0 not like '%Informations Personnelles%' and
DisplayName0 not like '%Microsoft Silverlight%' and
DisplayName0 not like '%Java%' and
DisplayName0 not like '%Fingerprint%' and
DisplayName0 not like '%Microsoft Visual%' and
DisplayName0 not like '%HP Quick%' and
DisplayName0 not like '%Microsoft Operations%' and
DisplayName0 not like '%Mise %jour%' and
DisplayName0 not like '%Hotfix%' and
DisplayName0 not like '%Internet Explorer%' and
DisplayName0 not like '%Genuine%' and
DisplayName0 not like '%J2SE%' and
DisplayName0 not like '%MSXML%' and
DisplayName0 not like '%Windows Media%' and
DisplayName0 not like '%Adobe%Player%' and
DisplayName0 not like '%Windows XP%' and
DisplayName0 not like '%Update%' and
DisplayName0 not like '%Broadcom%' and
DisplayName0 not like '%ATI%' and
DisplayName0 not like '%WIMGAPI%' and
DisplayName0 not like '%RDC%' and
DisplayName0 not like '%WebFldrs XP%' and
DisplayName0 not like '%cartes%puce%' and
DisplayName0 not like '%Synaptics Pointing Device Driver%' and
DisplayName0 not like '%.NET Memory Profiler 3.5%' and
DisplayName0 not like '1500%' and
DisplayName0 not like '2400%' and
DisplayName0 not like '3.1.5' and
DisplayName0 not like '32 Bit%' and
DisplayName0 not like 'Correctif%' and
DisplayName0 not like '5300_5400' and
DisplayName0 not like '64 Bit%' and
DisplayName0 not like '6500%' and
DisplayName0 not like '8600%' and
Publisher0 not like '%Hewlett%Packard%' and
Publisher0 not like 'ATI%'

and fcm.CollectionID='SMS00004'
GROUP BY v_Add_Remove_Programs.DisplayName0, v_Add_Remove_Programs.Publisher0, v_R_System.Netbios_Name0
Order by Count(ProdID0) desc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bibi92Author Commented:
Thanks bibi
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.