insert into from 是怎么用的?

insert into table_a(field_a1,field_a2,field_a3) select field_b1,field_b2,field_b3 from table_b
实例:
insert into biz_dict(id,BIZ_TYPE,biz_value,biz_desc) select t1.id,t1.data_dictionary_type,t1.data_dictionary_value,t1.data_dictionary_desc from data_dictionary t1 
where t1.data_dictionary_type='省份'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
insert into from 是一个错误的语法,正确的语法是 insert into table_name select * from table_name2,它的作用是将 table_name2 中的数据插入到 table_name 中。在的例子中,insert into biz_dict(id,BIZ_TYPE,biz_value,biz_desc) select t1.id,t1.data_dictionary_type,t1.data_dictionary_value,t1.data_dictionary_desc from data_dictionary t1 where t1.data_dictionary_type='省份',将满足条件 t1.data_dictionary_type='省份' 的数据从 data_dictionary 表中的指定字段插入到 biz_dict 表中的指定字段。 在和的例子中,insert into 语句用于向表中插入数据,而不是从另一个表中复制数据。以为例,Insert into Table1 values('赵','asds','90') 将一行数据插入到 Table1 表中的指定字段。123 #### 引用[.reference_title] - *1* [insert into from 是怎么用的?](https://blog.csdn.net/Ideality_hunter/article/details/54378801)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] - *2* *3* [select into 和 insert into from的区别](https://blog.csdn.net/zy943453722/article/details/72835840)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值