Skip to content
Advertisement

Tag: string-concatenation

How can I use IF and CONCAT within SELECT

I have this Adjacency List Model table Table: Output: So I have the following query that duplicates a Site 1 e.g. and its children. In this case, the children are Paper with parent_id = 2 and ms1 with parent_id = 3 Output: As you can see Site 1 and its children got duplicated with a new unique id. However for

Replace a recurring word and the character before it

I am using SQL Server trying to replace each recurring “[BACKSPACE]” in a string and the character that came before the word [BACKSPACE] to mimic what a backspace would do. Here is my current string: “This is a string that I would like to d[BACKSPACE]correct and see if I could make it %[BACKSPACE] cleaner by removing the word and $[BACKSPACE]

Presto equivalent of CONCAT_WS

I’m looking for a function in Presto to concat two columns with a separator like underline. Answer Your are looking here for the array_join function, see docs. array_join(x, delimiter, null_replacement) → varchar Concatenates the elements of the given array using the delimiter and an optional string to replace nulls. Example: columns are c1,c2 you can add more of course: Results

Advertisement