I have a table named res_partner in PostreSQL (v9.3) with the following columns:
phone | character varying(64) |
mobile | character varying(64) |
I would like to concatenate both strings in the following way: "phone/mobile"
E.g:
+34942246573 / +3466243765
I'm trying the following in a SQL query:
SELECT (phone || '/' || mobile) AS PhoneNumbers FROM res_partner;
The query works fine when the person has both 'phone' and 'mobile' populated:
myDB=# SELECT id, (phone || '/' || mobile) AS PhoneNumbers FROM res_partner WHERE id=43;
id | phonenumbers
----+---------------------
43 | 942686868/666666666
But if the person has only phone or mobile (but not both) populated, all I get is an emtpy string:
myDB=# SELECT id, (phone || '/' || mobile) AS PhoneNumbers FROM res_partner WHERE id=21;
id | phonenumbers
----+--------------
21 |
(1 fila)
But in this case I would expect to show something as "+54 341 324 9459 / " for PhoneNumbers
Why is showing an empty string at the output?