Version 2 (modified by cedric, 14 years ago) (diff) |
---|
back to first page..
back to WRBD
drop table if exists wrbd.fish_fi; create table wrbd.fish_fi ( fi_folio_no character varying(50), fi_st_id character varying(10), fi_fish_id character varying(10), fi_date date, fi_year integer, fi_individual_life character varying(10), fi_retained character varying(10), fi_length numeric ); copy wrbd.fish_fi from 'C:/base/Operation_fish_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';' ; copy wrbd.fish_fi from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/Operation_fish_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';' header; copy wrbd.fish_fi(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 ;
{{ --1016 lines alter table wrbd.fish_fi rename column fi_id to fi_fishid; alter table wrbd.fish_fi add column fi_id serial PRIMARY KEY;
-- pour aller rajouter les op_id dans la table poissons select * from wrbd.operation_op order by op_date; -- un pb de date update wrbd.operation_op set op_date='2009-09-27' where op_date='0009-09-27' select * from wrbd.fish_fi left join (select * from wrbd.operation_op where op_nbtotal>0)as ope on (fi_date,fi_st_id)=(ope.op_date,ope.op_st_id) ; --2357 select count(*) from wrbd.fish_fi; -- 2208 -- voir les changements dans operation pour règler le pb de jointure }}}