I have a SQL Server stored procedure wherein I am creating a table using another table.
Select Distinct
col1
,col2
,col3
,col4
into table_2
from table_1;
Above statement will create a new table as ' table_2' with the selected list of columns.
I tried to convert the above query into Oracle syntax:
Create table table_2 as
select
col1
,col2
,col3
,col4
from table_1;
This is working fine as expected when I am running it in the editor. However, the same statement is giving me errors when I am trying to use this in Oracle Procedure.
I have gone through some links or so, which says that need to create some temp variables or storage or loop in to perform the same task.
I am getting very confused now and don't know how to convert this simple statement into valid Oracle syntax.