I have table like this:
CREATE TABLE public."Payments"
(
user_id integer,
"1 month later" numeric(19,4),
"2 months later" numeric(19,4),
"3 months later" numeric(19,4),
"4 months later" numeric(19,4),
"5 months later" numeric(19,4),
"6 months later" numeric(19,4),
"7 months later" numeric(19,4),
"8 months later" numeric(19,4),
"9 months later" numeric(19,4),
"10 months later" numeric(19,4),
"11 months later" numeric(19,4),
"12 months later" numeric(19,4)
with data inside for exampe like this:
INSERT INTO "Payments" ("user_id", "1 month later", "2 months later", "3 months later", "4 months later", "5 months later", "6 months later", "7 months later", "8 months later", "9 months later", "10 months later", "11 months later", "12 months later") VALUES (134329, 190, 190, 190, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
I need to get summ for every user ID, there is a lot of them. Is any function in postgres which can do it swiftly?