问题
I have multiple strings of the form {key1=value, key2=value2, key3=value3 ...} with a known set of keys. The key names are set and known, with only the values changing between records. I would like to tokenize the string with the space delimiter as my tokenizing character then strip off the key names and assign each one to a column in sequential order. Is this something I can do in-database in teradata 15?
回答1:
Starting with TD14 there's NVP
to extract data from name-value-pairs, e.g.
NVP(col, 'key1', '{ ,\ }', '=')
来源:https://stackoverflow.com/questions/31925691/how-to-tokenize-a-string-and-assign-tokens-to-column-in-teradata