sql怎样把两个字段合并成一个字段显示

sql怎样把两个字段合并成一个字段显示
2025-01-19 16:15:43
推荐回答(5个)
回答1:

access : 表.select 字段a & 表.字段B as 字段x from 表;
Oracle: 表.select 字段a || 表.字段B 字段x from 表;

回答2:

1、SELECT A+B FROM TABLE
2、如果是布尔值:SELECT A & B FROM TABLE

回答3:

ORACLE / DB2
||

SELECT A || B FROM xxx

回答4:

select 列1 || 列2 from 表名;

回答5:

Oracle
SQL> SELECT
2 CONCAT('Good ', 'Morning!') A,
3 'Good ' || 'Morning!' B
4 FROM
5 dual;

A B
-------------------------- --------------------------
Good Morning! Good Morning!

SQL Server
1> SELECT 'Good ' + 'Morning!' B
2> go
B
-------------
Good Morning!

(1 行受影响)

MySQL
mysql> select CONCAT('Good ', 'Morning!') A
-> //
+---------------+
| A |
+---------------+
| Good Morning! |
+---------------+
1 row in set (0.02 sec)