We help IT Professionals succeed at work.
Get Started

query with Distinct and count

475 Views
Last Modified: 2012-05-09
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
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2010
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE