ACTUALIZACION DE REGISTRO DE USUARIO CREADOR PARA PROYECTO CON BARBARA
UPDATE transactions
SET user_create_id
=11 WHERE user_create_id
= 1 AND project_id
= 27
Etiqueta: sql
Ediciones por SQL relacionadas con corrección de taxones.
Comando para cambiar taxones inferiores a otro taxón. principalmente usado cuando los taxones están duplicados
1 |
update taxon set taxonrelax_id='idnuevo' where taxonrelax_id='idviejo' |
Comando para detectar Taxones duplicados de un mismo nivel
1 |
select nombre,"nombre",subtipo_id,taxonrelax_id, count(*) from taxon where subtipo_id = 25 group by nombre,"nombre",subtipo_id,taxonrelax_id having count(*)>11 |
select nombre,»nombreComun»,subtipo_id,taxonrelax_id, count(*) from taxon where subtipo_id = 26 group by nombre,»nombreComun»,subtipo_id,taxonrelax_id having count(*)>1
Detectar familias duplicadas
select nombre,subtipo_id,taxonrelax_id, count(*) from taxon where subtipo_id = 18 group by nombre,subtipo_id,taxonrelax_id
having count(*)>1
Detectar generos duplicados
select nombre,subtipo_id,taxonrelax_id, count(*) from taxon where subtipo_id = 23 group by nombre,subtipo_id,taxonrelax_id
having count(*)>1
Para buscar nombres comunes
select id,taxonrelax_id,nombre,»nombreComun», count(*) from taxon where (subtipo_id = 26 and «nombreComun»<>») group by id,taxonrelax_id,nombre,»nombreComun»
Para detectar Genero+ Especie duplicados
select tax.nombre as genero, taxon.nombre as especie, count(*) from taxon, taxon tax where taxon.taxonrelax_id=tax.id and tax.subtipo_id=23 and taxon.subtipo_id=26
group by taxon.nombre, tax.nombre having count(*)>1
Para detectar Taxones duplicados (dentro de diferentes relaciones)
select nombre,subtipo_id, count(*) from taxon where subtipo_id = 2 group by nombre,subtipo_id having count(*)>1