Oracle的 CONCAT 函數(shù)用于將兩個或多個字符串連接在一起
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 函數(shù)。請注意,這里的示例是基于 Oracle 數(shù)據(jù)庫的 EMPLOYEES 表,您可能需要根據(jù)您的實際數(shù)據(jù)表進行調(diào)整。