In Oracle Database, we can concatenate strings and numbers with the CONCAT()
function or the pipe concatenation operator (||
).
The CONCAT()
Function
Here’s an example that uses the CONCAT()
function:
SELECT CONCAT('Comments: ', 234)
FROM DUAL;
Result:
Comments: 234
The Pipe Concatenation Operator (||
)
Here’s how to do the same thing using the concatenation operator (||
):
SELECT 'Comments: ' || 234
FROM DUAL;
Result:
Comments: 234