Changes between Version 9 and Version 10 of INTEGRATING stations


Ignore:
Timestamp:
Dec 6, 2010 1:05:35 PM (14 years ago)
Author:
cedric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • INTEGRATING stations

    v9 v10  
    154154copy wrbd.operation_op(op_st_id,op_year,op_equipment,op_nbnights,op_nbnets,op_nbtotal,op_cpue,op_totalweight,op_nbfem,op_nbmal,op_nbimmat) from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/8.lakes_operation.csv' with csv delimiter as ';' header ;  
    155155--1016 lines 
     156alter table wrbd.fish_fi rename column fi_id to fi_fishid; 
     157alter table wrbd.fish_fi add column fi_id serial PRIMARY KEY; 
     158 
     159-- pour aller rajouter les op_id dans la table poissons 
     160select * from wrbd.operation_op order by op_date; -- un pb de date 
     161update wrbd.operation_op set op_date='2009-09-27' where op_date='0009-09-27' 
     162select * from wrbd.fish_fi left join (select * from wrbd.operation_op where op_nbtotal>0)as ope  
     163on (fi_date,fi_st_id)=(ope.op_date,ope.op_st_id)  ; --2357 
     164select count(*) from wrbd.fish_fi; -- 2208 
     165-- OK c'est des pb d'années dans les dates 
     166select * from wrbd.operation_op where extract('year' from op_date) !=op_year; 
     167-- modification des dates concernées 
     168select to_date(cast(op_year AS text)||' '||cast(extract('month' from op_date) AS text)||' '||cast(extract('day' from op_date) AS text),'YYYY MM DD') from wrbd.operation_op where extract('year' from op_date) !=op_year; 
     169update wrbd.operation_op set op_date=to_date(cast(op_year AS text)||' '|| 
     170        cast(extract('month' from op_date) AS text)||' '|| 
     171        cast(extract('day' from op_date) AS text),'YYYY MM DD') 
     172        where extract('year' from op_date) !=op_year; 
    156173}}} 
    157174{{{