Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
On Thu, Mar 5, 2009 at 12:29 PM, Steve Atkins wrote: > > On Mar 5, 2009, at 11:17 AM, Richard Greenwood wrote: > >> Hello pgsql listers, >> >> I've got a problem that is similar to, but I don't think identical to, >> a cross tab query. My data looks like: >>  ID | CAT >>  1  |   A >>  1  |   B >>

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
On Thu, Mar 5, 2009 at 12:27 PM, wrote: > Have you tried using "group by"? Thanks, but that doesn't do it. If I group by ID I loose the CAT, group by CAT I loose the ID, group by bith and that's just the base table. Am I missing something? Regards, Rich >> Hello pgsql listers, >> >> I've got a

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread darren
Have you tried using "group by"? > Hello pgsql listers, > > I've got a problem that is similar to, but I don't think identical to, > a cross tab query. My data looks like: > ID | CAT > 1 | A > 1 | B > 2 | A > 2 | C > So for each ID there may be many CAT (categories). > The cl

Re: [GENERAL] not quite a cross tab query...

2009-03-05 Thread Steve Atkins
On Mar 5, 2009, at 11:17 AM, Richard Greenwood wrote: Hello pgsql listers, I've got a problem that is similar to, but I don't think identical to, a cross tab query. My data looks like: ID | CAT 1 | A 1 | B 2 | A 2 | C So for each ID there may be many CAT (categories). The clie

[GENERAL] not quite a cross tab query...

2009-03-05 Thread Richard Greenwood
Hello pgsql listers, I've got a problem that is similar to, but I don't think identical to, a cross tab query. My data looks like: ID | CAT 1 | A 1 | B 2 | A 2 | C So for each ID there may be many CAT (categories). The client wants it to look like: ID | CATS 1 | A,B 2