简体   繁体   中英

Concatenating fields in Amazon Redshift

I am doing this to create a key in Redshift SQL is there an issue with this code? (it's not populating with the name piece)

concat((name)+'-'+left(address_zip,5)) as key
CONCAT(CONCAT(name, '-'), left(address_zip, 5)) as key

or using || operator:

name || '-' || left(address_zip,5) as key

you can find the documentation here: https://docs.aws.amazon.com/redshift/latest/dg/r_CONCAT.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM