From: portaldev on
Thanks for responding. Ok I was being pretty abstract.
I've sent you a simple spreadsheet, I don't expect you to spend any
time on it,
it's just the easiest way to explain what I mean.
From: Tonkuma on
On Dec 3, 8:55 am, portaldev <barrybe...(a)gmail.com> wrote:
> Thanks for responding. Ok I was being pretty abstract.
> I've sent you a simple spreadsheet, I don't expect you to spend any
> time on it,
> it's just the easiest way to explain what I mean.
I can't receive mails, because my setting on mailing system was
broken.
From: Tonkuma on
Using XMLGROUP would be simpler on DB2 9.5 for LUW or later.

SELECT Dept
, SUBSTR(
XMLCAST(
XMLGROUP( ',' || name AS a
ORDER BY name)
AS VARCHAR(60) )
, 2) AS Names
FROM Employee
GROUP BY Dept
;

Also, see this:
http://www.dbforums.com/db2/1649748-simple-specs.html

(I don't know why I also used XMLTEXT in the example.)

Serge,
do you know any restriction or performance issue for using XMLGROUP in
this context?
From: Tonkuma on
On Dec 10, 11:40 pm, Tonkuma <tonk...(a)fiberbit.net> wrote:
> Using XMLGROUP would be simpler on DB2 9.5 for LUW or later.
>
> SELECT Dept
>      , SUBSTR(
>          XMLCAST(
>            XMLGROUP( ',' || name AS a
>                      ORDER BY name)
>            AS VARCHAR(60) )
>        , 2) AS Names
>   FROM Employee
>  GROUP BY Dept
> ;
>
This will work too:
SELECT Dept
, SUBSTR(
XMLCAST(
XMLGROUP( ',' AS a, name
ORDER BY name)
AS VARCHAR(60) )
, 2) AS Names
FROM Employee
GROUP BY Dept
;
From: Serge Rielau on
Tonkuma,
No clue. I'm the _SQ_L architect. :-)
I know a lot about very little reaching asympotically the point where I
know everything about nothing..

--
Serge Rielau
SQL Architect DB2 for LUW
IBM Toronto Lab

First  |  Prev  | 
Pages: 1 2 3
Prev: SQL0902C on db2 connect
Next: DDL file usage