cancel
Showing results for 
Search instead for 
Did you mean: 

Update table redshift

Raj
New Contributor II

I have a requirement where I need to populate running totals: Eg.

Date Product value cum_total
20180201 abc 5 5
20180202 abc 2 7
20180203 abc 4 11
20180204 abc 3 14

This is a simplified version. There are pre-processing to get the data to be loaded to this table. I need to read this table and update the cum_total. By looking at the Redshift Update, my select query will be from this table first 3 columns, and I generate cum_total and I need to update the same table based on the keys – col1 and col2.

Thanks.

4 REPLIES 4

dmiller
Former Employee

Is this similar to your other post, How to get Running Totals?


Diane Miller

Raj
New Contributor II

Yea. I can generate the running totals using sql, but to update i need to use a bunch of keys – at least 4. Looked at the Redshift Update snap and really not sure on how to use the where_clause.

Thanks.

aleung
Contributor III

PM me, if you like to discuss this over a call

Raj
New Contributor II

Got it. I should be using bulk upsert snap instead of update snap.

Cheers.