79632468

Date: 2025-05-21 17:16:31
Score: 1
Natty:
Report link

Thank you for this post. The last block of code wont run for me in snowflake . I changed ON to WHERE.

UPDATE ToTable as t2
    set val = r.total
    from (
        select ID, 
            sum(HiddenCash) + sum(Cash) + sum(income) as total
        from  SourceTable
        group by ID
    ) as r 
        on t2.ID= r.ID;


UPDATE ToTable as t2
    set val = r.total
    from (
        select ID, 
            sum(HiddenCash) + sum(Cash) + sum(income) as total
        from  SourceTable
        group by ID
    ) as r 
        where t2.ID= r.ID;
Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Greg