表复制语句

表复制语句有两种格式

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)

  

posted @ 2019-01-29 23:48  走步超人  阅读(288)  评论(0编辑  收藏  举报