Skip to main content
Question

Is there a way to concat more than 2 strings?

  • October 13, 2023
  • 2 replies
  • 5 views

Efi

I'm looking for a way (maybe creating function) to use concat with more than 2 string

2 replies

VValdar
Forum|alt.badge.img+1
  • Participating Frequently
  • October 13, 2023

Hi Efi,

You can use the double pipe like this:

select col1 || col2 || col3 ...

It's not one function but usually it's good enough.


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • October 13, 2023

if you really want to use a function and then you can use nested concatenation as present in the below link

https://docs.vertica.com/12.0.x/en/sql-reference/functions/data-type-specific-functions/string-functions/concat/