Re: Query Question

From: Mtek <mtek_at_mtekusa.com>
Date: Thu, 19 Jun 2008 14:16:56 -0700 (PDT)
Message-ID: <f5240e18-1036-430c-b217-3593b6aa7f34@s50g2000hsb.googlegroups.com>


On Jun 19, 4:08 pm, Donkey Hot <s..._at_plc.is-a-geek.com> wrote:
> Mtek <m..._at_mtekusa.com> wrote in news:c80264dd-be17-4754-a00e-483b4182e855
> @l28g2000prd.googlegroups.com:
>
>
>
> > Hi,
>
> > Is it possible to return all rows from a query on one line?
>
> > I have this query:
>
> > SELECT cnt || ':' || t_id
> > FROM (SELECT COUNT(*) cnt, t_id
> > FROM zc_body zb, zc_type zt
> > WHERE zb.t_id = zt.id
> > group by t_id);
>
> > It returns data like this:
>
> > 86:3
> > 994:7
> > 99:18
> > 38:27
> > 45:36
>
> > However, they want it in one line: 86:3,994:7,99:18,38:27,45:36
>
> > Can this be done?
>
> > Thanks!
>
> > John
>
> I have no idea about ultrasearch or workplace manager, but with plain old
> PL/SQL your can do it easily.

Yeah, I was hoping to avoid creating a function.......but if it the only way.

I'm seeing some elaborate SQL using CONNECT BY, OVER, SYS_CONNECT_BY_PATH, etc. All things I am not very familiar with.

And, none of them use a GROUP BY like I need, relating to the COUNT(*)...... So, I am in search mode.......

John Received on Thu Jun 19 2008 - 16:16:56 CDT

Original text of this message