-
Notifications
You must be signed in to change notification settings - Fork 45
Support for Create Table Using Another Table #216
Description
Is your feature request related to a problem? Please describe.
A very useful addition to the simple-ddl-parser would be the ability to parse and process the SQL Create Table Using Another Table. Currently there is support only for the Create command, and hence this feature will extend the functionality of this DDL parser.
Describe the solution you'd like
The solution must be able to parse the SQL CREATE command and create the table structure by referencing the table in the select statement which must exist in the same file. The new table gets the same column definitions.
Describe alternatives you've considered
NA
Additional context
Here are some examples for the Create Table Using Another Table command
Syntax
CREATE TABLE new_table_name AS
SELECT column1, column2,...
FROM existing_table_name
WHERE ....;
Example
CREATE TABLE Person (
person_id int,
last_name varchar(255),
first_name varchar(255),
address varchar(255),
city varchar(255)
);
CREATE TABLE TestTable AS
SELECT person_id, first_name, last_name
FROM Person;