表复制语句
Posted zhengxq21
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了表复制语句相关的知识,希望对你有一定的参考价值。
表复制语句有两种格式
1.Insert into Table2(field1,field2,...) select value1,value2,... from Table1
2.SELECT vale1, value2 into Table2 from Table1
例
insert into sl_recivable_origin_sub(select null, ro.orgin_recivable_no as origin_no,sov.rock_info_own as origin_sub_info_own ,SUM(sov.receipt_volume) as origin_sub_volume,null as origin_sub_count_volume,sov.sales_order_price as origin_sub_unit_price ,SUM(sov.sales_order_total_price) as origin_sub_amount,null as origin_sub_count_amount,null as origin_sub_count_month ,NOW() as origin_sub_create_time from sl_recivable_origin ro left join sl_sales_order_view sov on ro.orgin_salesorder_no = sov.sales_order_no where ro.orgin_recivable_no = #{originNo} group by sov.rock_info_own)
以上是关于表复制语句的主要内容,如果未能解决你的问题,请参考以下文章
sql 为所有表创建drop语句,并从表空间转储视图。只需运行此代码,然后将输出复制并粘贴到sql windo