When using XMLAGG
or XMLCONCAT
, it seems Teradata adds extra whitespace between the concatenated content:
with t (x) as (select 1)
select
xmlserialize(content xmlconcat(1, 2, 3) as varchar(1000)) a,
xmlserialize(content xmlagg(v order by v) as varchar(1000)) b
from (
select 1 from t
union all
select 2 from t
union all
select 3 from t
) as u (v)
The above produces:
|a |b |
|-----|-----|
|1 2 3|1 2 3|
Is there any way to avoid that extra whitespace artifact from XML concatenation and get this, instead?
|a |b |
|---|---|
|123|123|