Можно сделать процедуру
CREATE OR REPLACE PROCEDURE add_id (id_key NUMBER)
DECLARE prev_max NUMBER
BEGIN
SELECT MAX(row_num) INTO prev_max FROM your_table WHERE id = id_key;
INSERT INTO your_table(id, row_num) VALUES (id, prev_max + 1);
EXCEPTION
WHEN no_data_found THEN
prev_max := 1;
INSERT INTO your_table(id, row_num) VALUES (id, prev_max + 1);
END;
И называть ее так
BEGIN
add_id(6806969);
END;