Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
rbr199
Contributor II
Contributor II

Vertical Bar || merging coluns in Select database

Hi all.

I just got a database as a "heritage" from my former peer and I faced a problem while merging two columns into a new one as a Case. I tried to find several hints and guides, but the vertical bars command " || " worked well and I could find nothing even in Qlik guides explaining how it works.

The example below is that I'm using:

SELECT

          CTB.BATCH,
          CTB.SEQUENCE,
CTB.BATCH || '/' || CTB.SEQUENCE as BATCH _SEQUENCE,

FROM...

Does anyone knows why this works in Qlik? My former peer already left the company without this explanation for me and I can't reach him.

 

Labels (1)
5 Replies
Or
MVP
MVP

This isn't Qlik script. This is an SQL query that is passed on to the database as, so the concatenation is being handled on that side of things.

rbr199
Contributor II
Contributor II
Author

I agree with you, but the SQL concat I usually see uses a command +, not the ||. This still is a mistery for me.

Vishal_Gupta
Partner - Creator
Partner - Creator

Hi @rbr199,

 

SQL Concatenate Operator uses || not + if I am not wrong.

Please check SQL Documentations for more details on this.

For reference:

SQL | Concatenation Operator - GeeksforGeeks

If a post helps to resolve your issue, please accept it as a SOLUTION and leave a LIKE!
rbr199
Contributor II
Contributor II
Author

Thank you.

vinieme12
Champion III
Champion III

different database support different concatenation operators some support '+'  some support  '||'

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.