| Subject | Extrange behavior concatenating fields | 
|---|---|
| Author | Elkins Villalona | 
| Post date | 2008-03-31T16:36:18Z | 
Hello everyone. 
I've a table with FIELD_1 and FIELD_2
With two records
 
FIELD_1 FIELD_2
1111111111 JHON DOE
JANE DOE
When I try to concatenate those fields in a query like this
SELECT FIELD_1||FIELD_2 FROM TEST_TABLE
 
I just get one record
11111111111JHON DOE
 
And if try to concatenate those fields using a different approach like this
 
SELECT CASE WHEN FIELD_1 IS NULL THEN ' '||FIELD_2 ELSE
FIELD_1||FIELD_2 END FROM TEST_TABLE
The query returns no spaces to the left of the concatenated fields
 
11111111111JHON DOE
JANE DOE
 
And I'd like to have a result with spaces filling the field_1 when null
 
Any help will be appreciated
 
Elkins Villalona
 
[Non-text portions of this message have been removed]
            I've a table with FIELD_1 and FIELD_2
With two records
FIELD_1 FIELD_2
1111111111 JHON DOE
JANE DOE
When I try to concatenate those fields in a query like this
SELECT FIELD_1||FIELD_2 FROM TEST_TABLE
I just get one record
11111111111JHON DOE
And if try to concatenate those fields using a different approach like this
SELECT CASE WHEN FIELD_1 IS NULL THEN ' '||FIELD_2 ELSE
FIELD_1||FIELD_2 END FROM TEST_TABLE
The query returns no spaces to the left of the concatenated fields
11111111111JHON DOE
JANE DOE
And I'd like to have a result with spaces filling the field_1 when null
Any help will be appreciated
Elkins Villalona
[Non-text portions of this message have been removed]