clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 818513 fiddles created (9187 in the last week).

CREATE TABLE elbat AS SELECT * FROM (VALUES ('2019-01-01'::date, 1::integer), ('2019-01-02'::date, 2::integer), ('2019-01-02'::date, 3::integer), ('2019-01-04'::date, 4::integer), ('2019-01-07'::date, 5::integer), ('2019-01-07'::date, 6::integer) )v (date, id);
6 rows affected
 hidden batch(es)


SELECT date, id, dense_rank() OVER (ORDER BY date) day_num FROM elbat;
date id day_num
2019-01-01 1 1
2019-01-02 2 2
2019-01-02 3 2
2019-01-04 4 3
2019-01-07 5 4
2019-01-07 6 4
 hidden batch(es)