I'm trying to simply take the max from a list created from an OVER()
From the query:
SELECT DISTINCT productCode,baseProductDescription, COUNT(*) OVER(PARTITION BY baseProductDescription) AS DescriptionCount
WHERE productcode NOT LIKE '[A-Z]%'
ORDER BY productcode, baseProductDescription[code]
I get my results I want in the DescriptionCount column. So now i want to take the max from that column. I'm having a hard time getting this because i need the Order by and it won't let me create my CTE with it. Simply using the Max(BaseProductDescrition)
wont give me the results i want.
This may be simpler than i think.