Oracle的 CONCAT 函数用于将两个或多个字符串连接在一起
SELECT CONCAT(first_name, last_name) AS full_name
FROM employees;
SELECT CONCAT(CONCAT(first_name, ' '), last_name) AS full_name
FROM employees;
SELECT CONCAT(CONCAT(first_name, ' - '), last_name) AS full_name
FROM employees;
SELECT CONCAT(UPPER(first_name), ' ', UPPER(last_name)) AS upper_full_name
FROM employees;
SELECT CONCAT(first_name, CASE WHEN job_id = 'IT_PROG' THEN ' - Programmer' ELSE '' END) AS title_name
FROM employees;
通过这些示例,您可以了解如何在实际查询中灵活运用 Oracle 的 CONCAT 函数。请注意,这里的示例是基于 Oracle 数据库的 EMPLOYEES 表,您可能需要根据您的实际数据表进行调整。