top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to update or insert row using single condition?

+2 votes
53 views
How to update or insert row using single condition?
posted Sep 23, 2014 by Archana

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

MERGE INTO dept d
USING emp e
ON (d.deptno = e.deptno)
WHEN MATCHED
THEN
UPDATE SET d.name = e.ename,
d.job = e.job,
d.salary = e.salary,
d.deptno = e.deptno
WHEN NOT MATCHED
THEN
INSERT VALUES (e.ename,
e.job,
e.salary,
e.deptno);

answer Sep 24, 2014 by Arun Gowda
Similar Questions
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...