SELECT INTO
Purpose
Using this command you can create a table, similar to CREATE TABLE AS
. Refer to CREATE TABLE for more information.
Prerequisites
-
You need either the system privilege
USE ANY SCHEMA
or the object privilegeUSAGE
on the target schema, or the schema must be owned by you or one of your assigned roles. - You need the system privilege
CREATE ANY TABLE
, orCREATE TABLE
if the table is created in a schema owned by you or one of your assigned roles. - You need the appropriate
SELECT
privileges for all referenced objects.
Syntax
select_into::=
Usage Notes
- If columns are not directly referenced in the select list, but as compound expressions, then aliases must be specified for these columns.
- For detailed information about this syntax, refer to SELECT section.