-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
CREATE TABLE jsum (
    id INTEGER NOT NULL,
    jv JSON,
    PRIMARY KEY(id)
);
INSERT INTO jsum VALUES(1, '{"f":123}');
INSERT INTO jsum VALUES(2, '{"f":456}');
SELECT SUM(jv->>'$.f') FROM jsum;
DROP TABLE jsum;
