Hi, Consider there are two tables, emp and dept with deptno being common between them. I want to write a query, where in I want to get the common records of both the tables, using joins, and then insert the output to a new table.
Thanks
Murthy
Hi, Consider there are two tables, emp and dept with deptno being common between them. I want to write a query, where in I want to get the common records of both the tables, using joins, and then insert the output to a new table.
Thanks
Murthy
please try thr following
insert into newtable select e.f1,e.f2,e.f3,d.f1,d.f2,.... from emp e,dept d where e.deptno=d.deptno;
Hope the query below is fulfilled your requirement.
insert into output(select e.eno,e.ename,e.deptno from emp e,dept d where e.deptno=d.deptno)