@zakicoderduck.bsky.social

Group rows on consecutive dates with #SQL pattern matching SELECT ... FROM ... MATCH_RECOGNIZE ( ORDER BY dt MEASURES ... PATTERN ( init consecutive* ) DEFINE consecutive AS dt = PREV ( dt ) + 1 ) The pattern is a regular expression over the defined variables