Top "Analytic-functions" questions

Aggregation functions that can peek at rows returned from the same query.

Oracle 'Partition By' and 'Row_Number' keyword

I have a SQL query written by someone else and I'm trying to figure out what it does. Can someone …

sql oracle partition row-number analytic-functions
SQL Row_Number() function in Where Clause

I found one question answered with the Row_Number() function in the where clause. When I tried one query, I …

sql sql-server tsql analytic-functions
Taking the record with the max date

Let's assume I extract some set of data. i.e. SELECT A, date FROM table I want just the record …

oracle date max analytic-functions
MySQL get row position in ORDER BY

With the following MySQL table: +-----------------------------+ + id INT UNSIGNED + + name VARCHAR(100) + +-----------------------------+ How can I select a single row AND …

sql mysql analytic-functions
Calculating Cumulative Sum in PostgreSQL

I want to find the cumulative or running amount of field and insert it from staging to table. My staging …

sql postgresql window-functions analytic-functions cumulative-sum
SQL - ROW_NUMBER () OVER (ORDER BY) not working

It doesn't matter what I put in the ORDER BY clause, the order of the result set doesn't change. WITH …

sql sql-server sql-server-2008 sql-order-by analytic-functions
Using GROUP BY with FIRST_VALUE and LAST_VALUE

I'm working with some data that is currently stored in 1 minute intervals that looks like this: CREATE TABLE #MinuteData ( [Id] …

sql-server group-by aggregate-functions sql-server-2014 analytic-functions
Group by vs Partition by in Oracle

I am writing a query to fetch records from a Oracle warehouse. Its a simple Select Query with joins on …

sql oracle data-warehouse analytic-functions
Oracle Analytic functions - How to reuse a PARTITION BY clause?

I have written a complex SQL query with Oracle in which I want to use two analytic function over the …

oracle analytic-functions
Oracle Analytic function for min value in grouping

I'm new to working with analytic functions. DEPT EMP SALARY ---- ----- ------ 10 MARY 100000 10 JOHN 200000 10 SCOTT 300000 20 BOB 100000 20 BETTY 200000 30 ALAN 100000 30 TOM 200000 30 …

sql oracle analytic-functions top-n