Over(): Over() looks over the result set rows of the aggregation functions.Hence OVER() is implemented in the aggregation functions, it allow-us to access the details of the rows that have been aggregated by the aggregate functions.
Partition by: Over and partition by clause is used to wire up the result on the basis of particular field value.
We have a table sample For Ranking Functions with the following records.
Now we want to show the sum of salary by grouping them by salary. We have four records with salary 14 therefore sum is 56 and in second group we have two records with salary 20 hence sum is 40. The query will be:
The output of the above query will be as: