Skip to contents

Wraps obis_taxon_children()'s recursive walk as a self-contained read-only SELECT returning the distinct descendant taxonIDs. Handy for the API and for composing an aphiaid IN (...) filter.

Usage

obis_taxon_subtree_sql(aphiaid)

Arguments

aphiaid

one or more integer WoRMS AphiaID(s).

Value

a SQL string: WITH RECURSIVE taxon_tree AS (...) SELECT DISTINCT taxonID ....