连接运算符或 concat() 函数
Oracle SQL 和 PL / SQL ||
运算符允许你将两个或多个字符串连接在一起。
例:
假设以下 customers
表:
id firstname lastname
--- ----------- ----------
1 Thomas Woody
查询:
SELECT firstname || ' ' || lastname || ' is in my database.' as "My Sentence"
FROM customers;
输出:
My SentenceThomas Woody is in my database.
Oracle 还支持标准的 SQL CONCAT(str1, str2)
功能:
例:
查询:
SELECT CONCAT(firstname, ' is in my database.') from customers;
输出:
Expr1Thomas is in my database.