jmaclaurin
IS-IT--Management
I would like the query to output exactly as it is written and not sort, but from what I can find, SQL requires a group by or order by. When I remove them, I get errors. How can I do this?
Code:
SELECT TOP 100 PERCENT COUNT(MachineID) AS Total, DisplayName00 AS Application
FROM Add_or_Remove_Program_DATA
WHERE (DisplayName00 = 'Adobe Reader 7.0') OR
(DisplayName00 = 'Microsoft Data Access Components KB870669') OR
(DisplayName00 = 'Microsoft Office Outlook 2003') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB824146') OR
(DisplayName00 = 'Windows XP Hotfix - KB824146') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB828035') OR
(DisplayName00 = 'Windows XP Hotfix - KB828035') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB828028') OR
(DisplayName00 = 'Windows XP Hotfix - KB828028') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB835732') OR
(DisplayName00 = 'Windows XP Hotfix - KB835732') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB828741') OR
(DisplayName00 = 'Windows XP Hotfix - KB828741') OR
(DisplayName00 = 'Outlook Express Q837009') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB837001') OR
(DisplayName00 = 'Windows XP Hotfix - KB837001') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB841873') OR
(DisplayName00 = 'Windows XP Hotfix - KB841873') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB840315') OR
(DisplayName00 = 'Windows XP Hotfix - KB840315') OR
(DisplayName00 = 'Microsoft VGX Q833989') OR
(DisplayName00 = 'Windows XP Hotfix - KB833987') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB824151') OR
(DisplayName00 = 'Windows XP Hotfix - KB824151') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB841533') OR
(DisplayName00 = 'Windows XP Hotfix - KB841533') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB840987') OR
(DisplayName00 = 'Windows XP Hotfix - KB840987') OR
(DisplayName00 = 'Windows XP Hotfix - KB873376') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB841356') OR
(DisplayName00 = 'Windows XP Hotfix - KB841356') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB890175') OR
(DisplayName00 = 'Windows XP Hotfix - KB890175') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB891711') OR
(DisplayName00 = 'Windows XP Hotfix - KB891711') OR
(DisplayName00 = 'Windows Media Player 9 Hotfix [See KB885492 for more information]') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB885250') OR
(DisplayName00 = 'Windows XP Hotfix - KB885250') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB873333') OR
(DisplayName00 = 'Windows XP Hotfix - KB873333') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB891781') OR
(DisplayName00 = 'Windows XP Hotfix - KB891781') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB867282') OR
(DisplayName00 = 'Windows XP Hotfix - KB867282') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB888113') OR
(DisplayName00 = 'Windows XP Hotfix - KB888113') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB893086') OR
(DisplayName00 = 'Windows XP Hotfix - KB893086') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB892944') OR
(DisplayName00 = 'Windows XP Hotfix - KB892944') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB890859') OR
(DisplayName00 = 'Windows XP Hotfix - KB890859') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB893066') OR
(DisplayName00 = 'Windows XP Hotfix - KB893066') OR
(DisplayName00 = 'Windows 2000 Hotfix - KB890923') OR
(DisplayName00 = 'Windows XP Hotfix - KB890923') OR
(DisplayName00 = 'Windows XP Hotfix - KB833987') OR
(DisplayName00 = 'Windows 2000 Service Pack 4')
GROUP BY DisplayName00
ORDER BY DisplayName00