I am trying to do something like the following,
select * into temp from (select * from student);
It gives me the following error,
ERROR at line 1:
ORA-00905: missing keyword
In my real example the subquery (select * from student) is more complex.
I want to use this in a stored procedure, so I don't want to create the table itself. I just want to make my code more readable by using a temp table.
After creating the table, we can insert data into it as the persisted tables. At the same time, we can create a temporary table using the SQL SELECT INTO statement command.
Now, to see where this table exists; go to “Object Explorer -> Databases -> System Databases-> tempdb -> Temporary Tables”. You will see your temporary table name along with the identifier.
If the table temp does not exist, you have to create it.
CREATE TABLE temp as
SELECT * FROM student;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With