Skip to content Skip to sidebar Skip to footer
Showing posts with the label Window Functions

Postgresql: Identifying Return Visitors Based On Date - Joins Or Window Functions?

I am looking to identify return visitors to a website within a 7 day window. A data sample and atte… Read more Postgresql: Identifying Return Visitors Based On Date - Joins Or Window Functions?

Row_number() Shows Unexpected Values

My table has values like (RowCount is generated by the query below): ID Date_trans Time_tra… Read more Row_number() Shows Unexpected Values

Oracle Sql, Fill Missing Value With The Closest Non-missing

I have a dataset in which I want to fill missing values witht the closest non-missing value. I foun… Read more Oracle Sql, Fill Missing Value With The Closest Non-missing

Sql Or Linq: How Do I Select Records Where Only One Paramater Changes?

Say we have this list: Id IdRef myColumn anotherColumn 448 70 1 228 449 … Read more Sql Or Linq: How Do I Select Records Where Only One Paramater Changes?

Tsql Over Clause: Count(*) Over (order By A)

This is my code: USE [tempdb]; GO IF OBJECT_ID(N'dbo.t') IS NOT NULL BEGIN DROP TABLE … Read more Tsql Over Clause: Count(*) Over (order By A)

Rolling (moving) Median In Greenplum

I would like to calculate the rolling median for a column in Greenplum, i.e. as below: | x | rolli… Read more Rolling (moving) Median In Greenplum

Decode Maximum Number In Rows For Sql

I am using the #standardsql in bigquery and trying to code the maksimum ranking of each customer_id… Read more Decode Maximum Number In Rows For Sql

How To Enumerate Groups Of Partitions In My Postgres Table With Window Functions?

Suppose I have a table like this: id | part | value ----+-------+------- 1 | 0 | 8 2 | 0 … Read more How To Enumerate Groups Of Partitions In My Postgres Table With Window Functions?