Oracle doesn't have on duplicate key update Use MERGE instead:

MERGE INTO my_table trg
USING (SELECT 30 as question_id,0 as ug FROM DUAL
UNION ALL
SELECT 31,1 FROM DUAL) src ON (src.question_id = trg.question_id)
WHEN NOT MATCHED THEN INSERT(question_id, ug) VALUES
(src.question_id, src.ug)
WHEN MATCHED THEN UPDATE
SET trg.ug = src.ug
05-11 13:06