I would like to take a scientific name string a parse it into three separate columns - genus, species, and subspecies.
Examples:
Mustela nivalis -->
genus: Mustela
species: nivalis
subspecies: <blank>
Ophisaurus attenuatus longicaudus -->
genus: Ophisaurus
species: attenuatus
subspecies: longicaudus
Etheostoma sp. 9 -->
genus: Etheostoma
species: sp. 9
subspecies: <blank>
Noturus flavus pop. 1 -->
genus: Noturus
species: flavus
subspecies: pop. 1
I was trying to use substr/instr -
select substr(sn.scientific_name, 1,Instr(sn.scientific_name,' ') - 1) as Genus
but it doesn't really work for "pop. 1" or "sp. 9" where there are spaces that are supposed to be included.
Does anyone have any suggestions on how to do this?
Examples:
Mustela nivalis -->
genus: Mustela
species: nivalis
subspecies: <blank>
Ophisaurus attenuatus longicaudus -->
genus: Ophisaurus
species: attenuatus
subspecies: longicaudus
Etheostoma sp. 9 -->
genus: Etheostoma
species: sp. 9
subspecies: <blank>
Noturus flavus pop. 1 -->
genus: Noturus
species: flavus
subspecies: pop. 1
I was trying to use substr/instr -
select substr(sn.scientific_name, 1,Instr(sn.scientific_name,' ') - 1) as Genus
but it doesn't really work for "pop. 1" or "sp. 9" where there are spaces that are supposed to be included.
Does anyone have any suggestions on how to do this?