View Single Post
  #5 (permalink)  
Old 09-18-2006, 06:35 AM
srinivas
 
Posts: n/a
Default Oracle answer. Re: Insert or update a record if it already exists?

[sql]
merge into users U1
using (U1.username = 'Jo' )
when matched then
update set U1.email = 'jo@email.com'
when not matched then
insert(U1.email, U1.username)
values('Jo', jo@email.com);

[/sql]
Edit/Delete Message Reply With Quote