bug #6024
Updated by Andreas Müller over 7 years ago
Find replacement names that do not have a blocking name relationship
~~~ sql
SELECT tnb.id, tnb.uuid, tnb.titleCache
FROM TaxonNameBase tnb
WHERE tnb.id
IN
(SELECT relatedTo_id FROM NameRelationship nr WHERE nr.type_id = 906)
AND tnb.id NOT IN (
SELECT tnb.id
FROM TaxonNameBase tnb INNER JOIN NameRelationship bnrel ON bnrel.relatedTo_id = tnb.id AND bnrel.type_id = 902
WHERE tnb.id
IN
(SELECT relatedTo_id FROM NameRelationship nr WHERE nr.type_id = 906)
)
ORDER BY tnb.titleCache
~~~
~~~ text
"7746" "f20f12b2-2db4-431f-a06d-409445869edc" "Diospyros discolor Willd."
"19984" "adf2d458-e834-4c5a-a3ac-60e0da7d48a5" "Eulophia ecristata (Fernald) Ames"
"19864" "0953bd65-df4c-4ccd-adb0-493ae2b17a92" "Liparis jamaicensis Lindl. ex Griseb."
"1840" "01737338-f947-447b-b724-f19d9841ce7a" "Mariscus swartzii A. Dietr."
"8390" "c18ba0cc-e81d-4a3f-91b8-feb1e5b17ea2" "Nectandra anonyma Steud."
"8386" "7b6da163-1bd3-43da-95f2-51c08e22e706" "Nectandra neesii D. Dietr."
"19986" "ca79e7a3-6f16-4980-872a-571263420dc2" "Pteroglossaspis ecristata (Fernald) Rolfe"
~~~
Non species issues
AND (tnb.rank_id <> 790 OR bn.rank_id <> 790)
~~~ sql
"6556" "3b62c9ab-ad76-4618-91ad-961b6e71d3a3" "Buxus wrightii Müll. Arg. subsp. wrightii" "Buxus microphylla Siebold & Zucc." "788"
"1913" "77464776-5824-46fc-a540-01c5d6603935" "Cyperus tenuis var. capillaris (Sw.) Kük." "Cyperus capillaris J. Koenig ex Roxb." "785"
~~~