CodePudding user response:
Don't need a stored procedure, a single SQL can solve,
The create table as the select B table field list from B;
CodePudding user response:
To use dynamic SQL to do,CodePudding user response:
Agree with upstairs, only through a dynamic SQLIf it is a one-off operation, can be directly generated string, manual operation
CodePudding user response:
The second floor of the SQL is not to go, want a stored procedure stemCodePudding user response:
- copy table structure and data
The create table as the select B table field list from B;
- only copy table structure
The create table as the select B table field list from B list table fields where B=1;
CodePudding user response:
The Create table as select table columns field from B B where 1=0