System and Application Softwares
How to create a new table with the same structure of a specified table?
Suppose you have a table named employee with the following columns:
And you want to create new table named contract_workers with the same columns as employee table, the fastest way to chieve this is to run the following DDL statement:
CREATE TABLE contract_workers AS (SELECT * FROM employees where 1=2);
© 2019 Digcode.com. All rights reserved.