| 156 | alter table wrbd.fish_fi rename column fi_id to fi_fishid; |
| 157 | alter table wrbd.fish_fi add column fi_id serial PRIMARY KEY; |
| 158 | |
| 159 | -- pour aller rajouter les op_id dans la table poissons |
| 160 | select * from wrbd.operation_op order by op_date; -- un pb de date |
| 161 | update wrbd.operation_op set op_date='2009-09-27' where op_date='0009-09-27' |
| 162 | select * from wrbd.fish_fi left join (select * from wrbd.operation_op where op_nbtotal>0)as ope |
| 163 | on (fi_date,fi_st_id)=(ope.op_date,ope.op_st_id) ; --2357 |
| 164 | select count(*) from wrbd.fish_fi; -- 2208 |
| 165 | -- OK c'est des pb d'années dans les dates |
| 166 | select * from wrbd.operation_op where extract('year' from op_date) !=op_year; |
| 167 | -- modification des dates concernées |
| 168 | select 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; |
| 169 | update 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; |