Re: SQL - Is this even possible ?
Date: Thu, 13 Mar 2008 14:53:20 -0700 (PDT)
Message-ID: <bb2db0f7-cb84-45ba-88d0-025ae6433ce1@x30g2000hsd.googlegroups.com>
On Mar 13, 3:46 pm, "Shakespeare" <what..._at_xs4all.nl> wrote:
> "marfi95" <marf..._at_yahoo.com> schreef in berichtnews:f835a4bd-5ecd-4e5d-b574-f11f15949e8e_at_n75g2000hsh.googlegroups.com...
>
>
>
>
>
> > Hello,
>
> > Is it possible given the following rows in a resultset to produce a
> > merged resultset as shown below.
>
> > Key1 Col1 Col2 Col3 Col4
> > ------------ --------- -------------
> > ---------- ----------
> > 1 A 1
> > 1
> > B 2
> > 10 C 3
> > 10 C 4
> > 10
> > D 3
> > 10
> > D 3
> > 18 F 5
> > 18 F 6
> > 18
> > G 5
> > 247 H 7
> > 247 H 8
> > 247
> > I 7
> > 247
> > I 9
> > 247
> > I 10
>
> > Need it like this:
>
> > Key1 Col1 Col2 Col3 Col4
> > ------------ --------- -------------
> > ---------- ----------
> > 1 A 1
> > B 2
> > 10 C 3
> > D 3
> > 10 C 4
> > D 3
> > 18 F 5
> > G 5
> > 18 F 6
> > 247 H 7
> > I 7
> > 247 H 8
> > I 9
> > 247
> > I 10
>
> > Basically, I'm just trying to merge rows together based on key1.
>
> > Any help is greatly appreciated.
>
> Look about 20-30 rows down in this group.Title: Consolidation of multiple
> rows.
>
> Shakespeare- Hide quoted text -
>
> - Show quoted text -
Thanks for the reply. I didn't see much there past the first few entries. I had tried group by, but it consolidates down to one row, when in some instances I need multiple. I now group by multiple columns and it seems to be doing what I need.
Thanks again ! Received on Thu Mar 13 2008 - 16:53:20 CDT