Parameters: (String csv_list);
Returns: String;
Function to remove duplicate calues from a comma delimited list of string values
The csv_list parameter:
- Must have its values delimited by commas with no whitespace before or after the commas.
- May optionally contain values that are delimited by double quotes. This may be used to include value that contain commas.
- May be NULL or empty
The function will go through each of the values and remove any that are identical to a previous value. If double quotes are used to delimit the values, these are not included in the comparison.
If the parameter is NULL, NULL will be returned.
An error can occur if the csv list is not correctly formatted (for example has an unclosed double qute delimiter)
The values in the lists may be delimited using a double quote (") character.
The returned list will use double quotes to delimit values only if the value contains a comma.
A maximum of 1000 values are supported.
Example 1:
field1= REMOVE_LIST_DUPLICATES('1,2,3,3,4,5,5,6,7,8,2')
Result:
field1=1,2,3,4,5,6,7,8
Example 2:
field2= REMOVE_LIST_DUPLICATES('London,New York,Paris,"London"')
Result:
field2=London,New York,Paris
Comments
0 comments
Please sign in to leave a comment.