Prev: SQL0902C on db2 connect
Next: DDL file usage
From: portaldev on 2 Dec 2009 18:55 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 3 Dec 2009 12:00 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 10 Dec 2009 09:40 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 11 Dec 2009 11:43 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 11 Dec 2009 18:28
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 |