-
SQL Help
What I'm trying to get is a report in that shows how many times a DCN Number appears in the report.
I get that but I can't order the Report by the count.
I want the Greatest number of duplicates at the top of my report.
Code:
SELECT DISTINCT DCN, COUNT(*) AS TheCount
FROM dbo.ProviderOONUsage
WHERE (PrvNum LIKE '%829%')
GROUP BY TheCount
Can someone help me?
Thanks,
-Ober
-
Code:
SELECT DCN, COUNT(*) AS TheCount
FROM dbo.ProviderOONUsage
WHERE (PrvNum LIKE '%829%')
GROUP BY DCN
ORDER BY TheCount
TG
-
Use ORDER BY TheCount DESC to get the largest numbers first... :o