Updating multiple records in oracle
delete from emp where empno=102; If you don’t mention the WHERE condition then all rows will be deleted. For example suppose we are having sales and sales_history table with the following structure.Suppose we want to delete all employees whose salary is above 2000. delete from emp where salary 2000; To delete all rows from emp table. Now we want to update sales_history table from sales table i.e.
In this article I will show you the most common methods of using the UPDATE statement.The following are the DML statements available in Oracle. For example the following statement inserts row in emp table by supplying values for empno, ename, and sal columns only. Insert into emp (empno,ename,sal) values (102,’Ashi’,5000); Suppose you want to add rows from one table to another i.e.Use the Insert Statement to Add records to existing Tables. suppose we have Old_Emp table and emp table with the following structure Now we want to add rows from old_emp table to emp table.When I ran the SELECT query on its own it returned 163 rows. Here’s the SELECT query I ran Users can have multiple email addresses but the UPDATE query is matching on contact ID in the WHERE clause.However, when I ran the UPDATE query it updated 210 rows. This would update other addresses associated that contact ID has as well.