sql语句咋写?
时间:2011-09-27
来源:互联网
insert into table select * from test;
test表中有一个字段我是通过程序生成的,其他字段都是原值。非得一个个字段写吗?
insert into tabel select '外部生成',col1,col2,col3,..... from test;
求解!谢谢!
作者: todaydiy 发布时间: 2011-09-27
insert into tabel1 select * from test;
来插入了,否则,你最好还是把字段都列出来吧,
insert into tabel1(column1,column2...)
select a,b...
from test;
作者: jimmylin040 发布时间: 2011-09-27
alter table tables1 drop column '外部生成';
^_^
作者: yixilan 发布时间: 2011-09-27
如果你tabel1的字段和你test表的字段完全相同(包括列数和类型),那么就可以用
insert into tabel1 select * from test;
来插入了,否则,你最好还是把字段都列出来吧,
insert into tabel1(column1,column2...)
select a,b...
from test;
字段太多了,超过100个字段。
作者: todaydiy 发布时间: 2011-09-27
create table tables1 as select * from test;
alter table tables1 drop column '外部生成';
^_^
美女,这招杀伤力太大了。
作者: todaydiy 发布时间: 2011-09-27
引用 2 楼 yixilan 的回复:
create table tables1 as select * from test;
alter table tables1 drop column '外部生成';
^_^
美女,这招杀伤力太大了。
呵呵 $_$
作者: yixilan 发布时间: 2011-09-27
作者: cosio 发布时间: 2011-09-27
作者: todaydiy 发布时间: 2011-09-27
作者: xiaobn_cn 发布时间: 2011-09-27
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28