join two string columns columnwise

Hi,

I am trying to join 2 columns columnwise. I tried to do the following but it returns a list of varchar. How do I convert it into a single string. If this is not possible, any other suggestions?

thanks.

q)t:(b:sgasa;c:30 10 43 13 24;g:ssggaassaa)

q)t

b c  g


s 30 ss

g 10 gg

a 43 aa

s 13 ss

a 24 aa

q)

q)p:select BG:(b,'g) from t

BG


s ss

g gg

a aa

s ss

a aa

q)meta p

c | t f a

–| -----

BG| S

Hi Sam,

Is this what you are looking for…

q)t:(b:sgasa;c:30 10 43 13 24;g:ssggaassaa)

q)t

b c ?g


s 30 ss

g 10 gg

a 43 aa

s 13 ss

a 24 aa

q)select BG:((string b),'string g) from t

BG


“sss”

“ggg”

“aaa”

“sss”

“aaa”

q)meta select BG:((string b),'string g) from t

c | t f a

–| -----

BG| C

Thanks Rory

Yes Thank you. I was trying so many things and got confused. Thanks for your help.

Hi Rory,

Do you know how to put a hyphen (-) between the combined columns? So the resulting merged column looks like this -

BG

“s-ss”

“g-gg”

..

thanks

Sam

This will help
Select BG:((string b), ‘(“-”,’ string g)), from t

Cool thanks!