Search
 
SCRIPT & CODE EXAMPLE
 

SQL

deduplicate delimited string bigquery

CREATE OR REPLACE FUNCTION `project.dataset.delim_dedupe`(delim_str STRING, splitter STRING) RETURNS STRING LANGUAGE js
OPTIONS (description="Dedupes delimited string list.") AS R"""
if (delim_str == null){
    var deduped = null;
    return(deduped)} else {

      var arr = delim_str.split(splitter);
      
      var deduped = [...new Set(arr)]};

    return(deduped.join(splitter))
""";
Comment

PREVIOUS NEXT
Code Example
Sql :: Oracle Function execution 
Sql :: mysql delete connected entries from database 
Sql :: sql_inner_join 
Sql :: difference between ltrim and rtrim in sql server 
Sql :: sql data type of query 
Sql :: influxdb clone measurement 
Sql :: get start of week big query 
Sql :: ring MySQL Restore Image From The Database 
Sql :: narural join 
Sql :: sql eomonth(getdate) 
Sql :: concatenate sqlites 3 
Sql :: What are the advantages of MySQL when compared with Oracle? 
Sql :: QUERY JPQL 
Sql :: plsql check how much space all databases are consuming 
Sql :: NLS_NCHAR_CHARACTERSET 
Sql :: create user oracle hash by value 
Sql :: phpmyadmin tabellentyp ändern 
Sql :: suhaib 
Sql :: scheduled mysql database backup in linux 
Sql :: minecraft duping allowed servers 
Sql :: sqlcl format 
Sql :: procedure excute monthly oracle 
Sql :: postgresql GRANT role_2 TO role_1 
Sql :: ltrim in sql 
Sql :: tsql For XML Path('), TYPE).value 
Sql :: sqlite3 create table from another table 
Sql :: create query in where clasue 
Sql :: c# execute transact sql 
Sql :: Inner join steps 
Sql :: Run batch file from SQL 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =