We have moved to www.dataGenX.net, Keep Learning with us.

Tuesday, December 09, 2014

Create table from another table in Oracle database


How to do the same in Oracle DB as we did in DB2 -Create table from another table in DB2 database
In Oracle, it is quite simple to create the duplicate tables with data :-)

Let's see How --



---------------------------------------------------------------------------------------------------------------
-- Create table from another table in Oracle database
CREATE TABLE new_table
AS (SELECT column_1, column2, ... column_n
FROM old_table);
-- We can create with Multiple tables also
CREATE TABLE new_table
AS (SELECT column_1, column2, ... column_n
FROM old_table_1, old_table_2, ... old_table_n);
view raw CrtTabOra.sql hosted with ❤ by GitHub
---------------------------------------------------------------------------------------------------------------

** when creating a table in this way, the new table will be populated with the records from the existing table


Like the Facebook Page & join Group
https://www.facebook.com/DataStage4you
https://www.facebook.com/groups/DataStage4you

https://twitter.com/datastage4you
https://groups.google.com/d/forum/datastage4you
For WHATSAPP group , drop a msg to 91-88-00-906098


No comments :

Post a Comment