# 使用管道运算符连接字符串

__*PIPES_AS_CONCAT SQL 模式*__

+ 例如:
  + `SET sql_mode=PIPES_AS_CONCAT;` 
  + `SELECT 'Welcome'||' to '||'TiDB!';` 

```10
tidb> set sql_mode=~!@PIPES_AS_CONCAT@!~;
Query OK, 0 rows affected (0.00 sec)

tidb> select 'Welcome'||' to '||'TiDB!';
+----------------------------+
| 'Welcome'||' to '||'TiDB!' |
+----------------------------+
| Welcome to TiDB!           |
+----------------------------+
1 row in set (0.00 sec)
```
---------------------------------------------------------
默认情况下,|| 为 OR。
```
tidb> select 'Welcome'||' to '||'TiDB!';
+----------------------------+
| 'Welcome'||' to '||'TiDB!' |
+----------------------------+
| 0                          |
+----------------------------+
1 row in set, 3 warnings (0.00 sec)

tidb> set sql_mode=PIPES_AS_CONCAT;
Query OK, 0 rows affected (0.00 sec)

tidb> select 'Welcome'||' to '||'TiDB!';
+----------------------------+
| 'Welcome'||' to '||'TiDB!' |
+----------------------------+
| Welcome to TiDB!           |
+----------------------------+
1 row in set (0.00 sec)
```
