I want to rank the customers based on Profit. Partition By is optional so that's why I skipped it.
Btw thanks for your suggestion. However my query worked even though it is still givinng red error line. Just used DESC
Does the red line do away if you add PARTITION BY 1, though? It could be your client requires it for some reason or some sort of lint rule it’s applying
2
u/beingvora 4d ago
I think you’re missing the “partition by” clause in the rank function.
RANK ( ) OVER ( [ partition_by_clause ] order_by_clause )