grab all records from one table to another oracle sql 1

grab all records from one table to another oracle sql

--tbl_temp1 is the source
--tbl_temp2 is the destination
--fld_id is the columns you want to bring over
--where statement is up to you!

INSERT INTO tbl_temp2 (fld_id)
SELECT tbl_temp1.fld_order_id
FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;

Here is what the above code is Doing:
1. It’s creating a table called tbl_temp1
2. It’s creating a table called tbl_temp2
3. It’s inserting data into tbl_temp1
4. It’s inserting data into tbl_temp2
5. It’s selecting data from tbl_temp1 and inserting it into tbl_temp2

Similar Posts