If i do:
SELECT MAX(Revenue_Spend) AS "Largest Amount Spent" FROM MaxCents
I get the max amount spent, but I can't figure out how to get it to display the userID as well.
There is no need to aggregate the data. We already did that with the CTE. Which row do you want from the CTE?
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter
.Cross Tabs and Pivots, Part 1 – Converting Rows to Columns Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs Understanding and Using APPLY (Part 1)Understanding and Using APPLY (Part 2)