Search code examples
sqloraclewindow-functions

what does the "()" do within an rank statement


Just curious what the "()"'s do in "rank ()" statements and how I can apply them.

for example the following is a standard rank query but I have never populated "()" just the brackets after "OVER" keyword and am curious what it's purpose is?

SELECT RANK() OVER (ORDER BY col1 DESC)
FROM DUAL;

Solution

  • RANK() is a function that takes no arguments.

    Calling a function (generally) requires the parentheses. They simply indicate that it is a function call. In this case, the function requires the rest of the window frame, so OVER is required.