我有两张桌子:The Name is: nama The Tag/Type is: input / text The Value is:
The Name is: kontak The Tag/Type is: input / text The Value is:
The Name is: email The Tag/Type is: input / text The Value is: xxx@ttt
The Name is: userid The Tag/Type is: input / text The Value is:
The Name is: foto The Tag/Type is: input / file The Value is: Winter.jpg
The Name is: id_jabatan The Tag/Type is: input / hidden The Value is: 2
The Name is: simpan The Tag/Type is: input / submit The Value is: Simpan
Nama :
Kontak :
Email :
UserID :
Foto :
,table1
。我需要混合它们,然后table2
新表。
以下是我的例子:
create
所以,我需要这样的东西:
// table1:
+------+------+
| col1 | col2 |
+------|------+
| 111 | 222 |
| 333 | 444 |
+------+------+
// table2:
+------+------+
| col1 | col2 |
+------|------+
| 555 | 666 |
| 777 | 888 |
+------+------+
我该怎么做?
答案 0 :(得分:1)
使用union
create table table3 as
select col1, col2 from table1
union all
select col1, col2 from table2
答案 1 :(得分:0)
如果您想删除相同的项目,可以
create table new_table as
select col1, col2 from table1
union
select col1, col2 from table2