Changes between Version 1 and Version 2 of INTEGRATING fish


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

--

Legend:

Unmodified
Added
Removed
Modified
  • INTEGRATING fish

    v1 v2  
    11back to first page[..] [[BR]] 
    22back to ["WRBD"][[BR]] 
     3 
     4{{{ 
     5#!sql 
     6drop table if exists wrbd.fish_fi; 
     7 
     8create table wrbd.fish_fi ( 
     9fi_folio_no character varying(50), 
     10fi_st_id character varying(10), 
     11fi_fish_id character varying(10), 
     12fi_date date, 
     13fi_year integer, 
     14fi_individual_life character varying(10), 
     15fi_retained character varying(10), 
     16fi_length numeric 
     17); 
     18 
     19 
     20copy wrbd.fish_fi from 'C:/base/Operation_fish_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';'  ;  
     21copy wrbd.fish_fi from 'D:/CelineJouanin/POSEProject/Ireland/DataIreland/Operation_fish_14_Eel_Db_MI_Rivers.csv' with csv delimiter as ';'  header;  
     22copy 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 ;  
     23 
     24}}} 
     25 
     26{{ 
     27--1016 lines 
     28alter table wrbd.fish_fi rename column fi_id to fi_fishid; 
     29alter table wrbd.fish_fi add column fi_id serial PRIMARY KEY; 
     30 
     31-- pour aller rajouter les op_id dans la table poissons  
     32select * from wrbd.operation_op order by op_date; -- un pb de date 
     33update wrbd.operation_op set op_date='2009-09-27' where op_date='0009-09-27' 
     34select * from wrbd.fish_fi left join (select * from wrbd.operation_op where op_nbtotal>0)as ope  
     35on (fi_date,fi_st_id)=(ope.op_date,ope.op_st_id)  ; --2357 
     36select count(*) from wrbd.fish_fi; -- 2208 
     37-- voir les changements dans operation pour règler le pb de jointure 
     38}}}