Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 892 → Rev 893

/trunk/scripts/modules/cel/referonosaure.sql
54,9 → 54,10
nom_sel_nn IS NOT NULL AND nom_ret_nn IS NOT NULL AND nom_ret_nn != 0
AND nom_referentiel = 'bdtfx'
AND nom_ret_nn = num_nom
AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL)
/* AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL) */
);
-- 339
-- 339 + 41373
SELECT ROW_COUNT() AS "BDTFX upd après correction sur nom_ret_nn + nom_sel_nn";
 
/* test:
SELECT c.nom_ret_nn, c.nom_ret, bLAST.num_nom, bLAST.nom_sci, bLAST.auteur, c.famille, bLAST.famille, c.nt, bLAST.num_taxonomique
84,7 → 85,8
AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL)
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(b.nom_sci, ' ', 1)
);
-- 251 avec indirection num_nom_retenu
-- 251 + 45649 avec indirection num_nom_retenu
SELECT ROW_COUNT() AS "BDTFX upd après correction sur nom_sel_nn";
 
 
-- l'update BDTXA avec nom_sel_nn et nom_ret_nn corrects --
98,27 → 100,27
AND nom_ret_nn = num_nom
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
);
-- 1
-- 1 + 49
SELECT ROW_COUNT() AS "BDTXA upd après correction sur nom_ret_nn + nom_sel_nn";
 
/*TODO
-- l'update BDTXA avec nom_sel_nn seul
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEBDTXA` a SET
c.nom_ret = CONCAT(a.nom_sci, ' ', a.auteur),
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEBDTXA` a, `BASESOURCE`.`TABLEBDTXA` a_nom_ret SET
c.nom_ret = CONCAT(a_nom_ret.nom_sci, ' ', a_nom_ret.auteur),
c.nom_ret_nn = a.num_nom,
c.nt = a.num_tax,
c.famille = a.famille
WHERE (
nom_sel_nn IS NOT NULL
a_nom_ret.num_nom = a.num_nom_retenu
AND nom_sel_nn IS NOT NULL
AND nom_referentiel = 'bdtxa'
AND nom_sel_nn = num_nom
AND nom_sel_nn = a.num_nom
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(a.nom_sci, ' ', 1)
);
-- 49 sans les restrictions sur famille et SUBSTRING_INDEX()
-- 47 avec les restrictions sur famille et SUBSTRING_INDEX()
*/
-- 47 + 49 avec les restrictions sur famille et SUBSTRING_INDEX()
-- 48 sans les restrictions sur famille et SUBSTRING_INDEX()
SELECT ROW_COUNT() AS "BDTXA upd après correction sur nom_sel_nn";
 
 
-- l'update ISFAN avec nom_sel_nn et nom_ret_nn corrects --
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i SET
c.nom_ret = CONCAT(i.nom_sci, ' ', i.auteur),
131,21 → 133,23
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
);
-- 2
SELECT ROW_COUNT() AS "ISFAN upd après correction sur nom_ret_nn + nom_sel_nn";
 
/*TODO
-- l'update ISFAN avec nom_sel_nn seul
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i SET
c.nom_ret = CONCAT(i.nom_sci, ' ', i.auteur),
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i, `BASESOURCE`.`TABLEISFAN` i_nom_ret SET
c.nom_ret = CONCAT(i_nom_ret.nom_sci, ' ', i_nom_ret.auteur),
c.nom_ret_nn = i.num_nom,
c.nt = i.num_taxonomique,
c.famille = i.famille
WHERE (
nom_sel_nn IS NOT NULL
i_nom_ret.num_nom = i.num_nom_retenu
AND nom_sel_nn IS NOT NULL
AND nom_referentiel = 'isfan'
AND nom_sel_nn = num_nom
AND nom_sel_nn = i.num_nom
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
);
*/
-- 0
SELECT ROW_COUNT() AS "ISFAN upd après correction sur nom_sel_nn";
 
/*
Pour observer les différences: