字符串运算符

运算符 ||

运算符 || 用于字符串连接,|| 左右都是字符串类型。

示例

  1. SELECT customer_name,
  2. customer_name || 'name',
  3. 'str1' || 'str2',
  4. 'str' || Cast(100 AS VARCHAR)
  5. FROM t_fact_customers
  6. WHERE customer_id < 4;
  7. +---------------+---------------+----------+--------+
  8. | customer_name | _col1 | _col2 | _col3 |
  9. +---------------+---------------+----------+--------+
  10. | 王小二 | 王小二name | str1str2 | str100 |
  11. | 李春梅 | 李春梅name | str1str2 | str100 |
  12. | 张大山 | 张大山name | str1str2 | str100 |
  13. +---------------+---------------+----------+--------+
阿里云首页 云原生数据仓库AnalyticDB MySQL版 相关技术圈