当满足a.province_id =b.province_id 和 a.user_id = b.user_id时从b表中提取字段更新到a表,类似于excel中Vlookup功能
update a set a.city = (select b.city_name from b
where a.province_id = b.province_id and a.user_id = b.user_id )where a.province_id = 114;
将a表中时间字段增加一定的天数重新插入的到a表中
insert into A
select to_date(to_char(start_time+212,‘yyyy-mm-dd‘),‘yyyy-mm-dd‘) start_time,task_id,model_id,oid,lc_name,province_id,
city_id,week_day,s_hour,s_day,s_week,s_month,gp,insert_time,f0001,f0002 from A where
start_time>=to_date(‘2014-11-02‘,‘yyyy-mm-dd‘) and
start_time<=to_date(‘2014-11-17‘,‘yyyy-mm-dd‘);
时间: 2024-10-05 04:43:30