1. 程式人生 > >表復制語句

表復制語句

group by ble ont value clas field info sum rec

表復制語句有兩種格式

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)

  

表復制語句