update a set time =substr(time,0,5)||'2'

解决方案 »

  1.   

    select a.num - b.num add_num    
    from (select * from 表A where time='200602')a, (select * from 表A where time='200601') b
    where a.area1_id = b.area1_id and a.area2_id = b.area2_id and a.type1_id = b.type1_id and a.type2_id = b.type2_id and a.type_3_id = b.type_3_id
      

  2.   

    select y.time ,y.area1_id , y.area2_id , y.type1_id , y.type2_id , y.type_3_id  ,
    y.num-x.num as "add_num"
    from a x, a y
    where (x.time=200601 and y.time=200602 and  x.type_3_id=y.type_3_id)
    ;