[英]select concat(first_name,' ',last_name) as "full name "from employees ---how to bring space when 2 columns are concatenated in oracle---
select concat(first_name,' ',last_name) as "full name "from employees
Oracle's CONCAT
function takes only two arguments. Oracle 的CONCAT
函数只接受两个参数。 So if you wanted to continue along with your exact current approach, you would have to chain together two calls to CONCAT
:因此,如果您想继续使用当前的确切方法,则必须将两个对CONCAT
调用链接在一起:
SELECT CONCAT(CONCAT(first_name, ' '), last_name) AS "full name"
FROM employees;
Or, you could just use the ANSI standard concatenation operator ||
或者,您可以只使用 ANSI 标准连接运算符||
: :
SELECT first_name || ' ' || last_name AS "full name"
FROM employees;
Use the operator ||
使用运算符||
: :
select (first_name || ' ' || last_name) as full_name
from employees
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.