Oracle Updagte if Exhist else Insert
merge into A outl using (select 1 id, 'A' ran,3 beat from dual) s on (outl.ID = s.id and outl.RANG=s.ran ) when matched then update set BEAT = s.beat when not matched then insert (ID, RANG,BEAT) values ( s.id , s.ran,s.beat);