I am somewhat new to Teradata. I am more familiar with Presto SQL, where split_part is available.
I'm looking to split a string on a space, hyphen, space (' - ').
Example: 'Wal-Mart - Target - Best Buy - K-Mart - Staples'
I'm used to using split_part(split_part(COLUMN, ' - ',2), ' - '), 1) to get Target, which ignores the hyphens in Wal-Mart and K-Mart because the hyphen is not preceeded and followed by a space.
But, I can't figure out how to get 'Target' with Teradata.
strtok() only seems to work with a single character, which isn't sufficient since I want to split on 3 (' - ').
Any help would be appreciated!