Reputation: 1139
Assume I have a table called Person
with columns name, surname and age.
I want to add two columns when performing a SELECT statment, probably something like this:
SELECT a FROM Person a WHERE a.name + a.surname LIKE ...
How can I do this correctly?
Upvotes: 1
Views: 31
Reputation: 7171
|| is the standard concat operator:
SELECT a FROM Person a WHERE a.name || a.surname LIKE ...
Note that you must have PIPES_AS_CONCAT set for that to work. As others have mentioned there is also a concat function that can be used.
Upvotes: 1
Reputation: 1270081
You do not add string values, like names. Presumably, you want to concatenate them, so you use the concat()
function:
where concat(a.name, a.surname) like . . .
Upvotes: 1