Home > database > How to get a table by a field content split into multiple tables?
How to get a table by a field content split into multiple tables?
Time:09-29
Found to have similar problems, but essentially, oracle writing, for reference, to weigh the address http://bbs.csdn.net/topics/100034393 A table is as follows: ID NAME CLASS 1 AA II 2 BB IV 3 AB IV 4 AC II 5 CC IX 6 SS II 7 AS IX 8 ES IX -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- With what method can be put on the table according to the content of the class is divided into multiple tables The results are as follows: ID NAME CLASS 1 AA II 4 AC II 6 SS II -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ID NAME CLASS 2 BB IV 3 AB IV -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ID NAME CLASS 5 CC IX 7 AS IX 8 ES IX
CodePudding user response:
create table t1 as select * from t where class='2'; The create table t2 as select * from t where class="IV"; The create table t3 as select * from t where class='x';
The table name, after t1 t2, t3 is t is the source table,
CodePudding user response:
This is, for example, is a large amount of actual if class, how to do, and method for batch build table