Insert into JHAC_TB_CODE(CID,CODE,ADD_TIME,USERID,PRO_CODE,USERNAME) select f_code.FID,f_code.Fcode,f_code.ADDDATE,f_code.USERS,f_code.CPCODE,f_code.USERNAME from f_codewhere f_code.Adddate between to_date('201201','yyyy-mm') and to_date('201301'…
先从历史表中查询最新的一个语句: select t.id from ( select r.*, row_number() over(partition by r.分组字段 order by r.排序时间 desc) rw from 表A r ' ) t 下面是完整语句:需要插入的表中字段要和下面查询语句字段对应上 insert into uav_flight_real_location (ID,LOCATION_TIME,GPS_LONGITUDE) select sys_guid() as i…