Hello!
Try the following query: SELECT RANK() OVER (ORDER BY start_date DESC NULLS
FIRST) R, * FROM test ORDER BY 1; Some rows have the same rank:
149 130 2019-01-11 00:00:00-05
150 217 2019-01-02 00:00:00-05
150 218 2019-01-02 00:00:00-05
152 164 2019-01-01 00:00:00-05
152 166 2019-01-01
I think I might have found a bug sorting by date but I could use some help
confirming.
I have attached a csv file with an “id” and “start_date” field which you can
load into a into a table like this:CREATE TABLE TEST (
ID BIGSERIAL NOT NULL,
START_DATE TIMESTAMP with time zone,