Skip to content

Tag: partition

Presto lag dates, group/partitioned by id

Say that I want to find every time that a client updated their budget. Here’s what my data looks like And the code I’ve run. What I’m expecting returned will be Hence there are NULL values for dt_2 in the first entry of each client_id. I’m not sure what code will accomplish this effect; is a GROUP BY clause will

SQL: Get row number which increases every time a value changes

I have the following table in Vertica: The table is ordered by column_1 and column_3. I would like to add a row number, which increases every time when column_1 or column_3 change their value. It would look something like this: I tried using partition over but I can’t find the right syntax. Answer Vertica has the CONDITIONAL_CHANGE_EVENT() analytic functions. It