Dynamically sum values from all columns without typing their names

Dear data scientists! I have different columns amount in a table depending on the date in the month. Is there an easy way (a processor or an SQL query) to sum values from all the existing columns in a new column without hardcoding the columns’ names (that should be summed up)?

You could use the extended mathematical operator or a query processor with

SELECT 
    *,
    AGGREGATE(ARRAY(*), DOUBLE(0), (acc, x) -> acc + x) AS column_sum
FROM inputTable i
1 Like

Thank you, @katharina.selig ! I forgot to mention, that one of the columns contains company names and should be avoided somehow, otherwise, your solution doesn’t work :grimacing: