I'm trying to write a query using DENSE_RANK() but I keep getting an error. It works in SSMS. I tried to break it down to the simplest I can:
SELECT DocEntry, DENSE_RANK() OVER (ORDER BY DocEntry) FROM INV1
I have had problems in the past with complicated queries and variables but I used the workaround to declare the variables first. But, I don't see why this query doesn't work. Thanks for the help.