Example:
From Table: Employee To Table : TmpEmployeeID FNAME LNAME ID FNAME LNAME1 Narottam Singh 1 Narottam Singh2 Ram Singh 2 Ram Singh
Mysql:
- Create a new table from the existing table without data
CREATE TABLE TmpEmployee asSELECT * FROM Employee where 1=2;
- Create a new custom column table from the existing table without data
CREATE TABLE TmpEmployee asSELECT FNAME FROM Employee where 1=2;
- Create a new table from the existing table with data
CREATE TABLE TmpEmployee asSELECT * FROM Employee;//ORCREATE TABLE TmpEmployee asSELECT * FROM Employee WHERE 1=1;
- Create a new custom column table from the existing table with data
CREATE TABLE TmpEmployee asSELECT FNAME FROM Employee;
- Create a new table from the existing table with filtered data
CREATE TABLE TmpEmployee asSELECT * FROM Employee where id=1;
Oracle
- Create a new table from the existing table without data
CREATE TABLE TmpEmployee asSELECT * FROM Employee where 1=2;
- Create a new custom column table from the existing table without data
CREATE TABLE TmpEmployee asSELECT FNAME FROM Employee where 1=2;
- Create a new table from the existing table with data
CREATE TABLE TmpEmployee asSELECT * FROM Employee;//ORCREATE TABLE TmpEmployee asSELECT * FROM Employee WHERE 1=1;
- Create a new custom column table from the existing table with data
CREATE TABLE TmpEmployee asSELECT FNAME FROM Employee;
- Create a new table from the existing table with filtered data
CREATE TABLE TmpEmployee asSELECT * FROM Employee where id=1;
No comments:
Post a Comment