Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SQL: mutiple rows one column to multiple columns one row

4 posts in PB Infomaker Report Writer Last posting was on 1998-11-26 15:56:45.0Z
Kaye Hendry Posted on 1998-11-25 17:06:48.0Z
Newsgroups: sybase.public.infomaker.general
Date: Wed, 25 Nov 1998 10:06:48 -0700
From: Kaye Hendry <kaye.hendry@healthinsight.org>
Organization: HealthInsight
X-Mailer: Mozilla 3.04 (Win95; I)
MIME-Version: 1.0
Subject: SQL: mutiple rows one column to multiple columns one row
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 16
Message-ID: <348_365C3928.7866@healthinsight.org>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6701
Article PK: 241687

In InfoMaker SQL can you take a table with multiple
rows for the same key and take a column from the
rows and create mutiple columns with one
report line with the key(no duplicate keys) on a report? For example

Table books
(key) (book title)
123 misery
123 titanic
123 roots
456 war
456 1984
456 giant

The report I need would look like this

Key title1 title2 title 3
123 misery titanic roots
456 war 1984 giant

Thanks in advance.
--
Kaye Hendry
HealthInsight
email:kaye.hendry@healthinsight.org


Terry Dykstra Posted on 1998-11-25 19:19:35.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra" <tdykstra@cfol.ab.ca>
Subject: Re: mutiple rows one column to multiple columns one row
Date: Wed, 25 Nov 1998 12:19:35 -0700
Lines: 34
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <348_4iNwB6JG#GA.159@forums.powersoft.com>
References: <348_365C3928.7866@healthinsight.org>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6700
Article PK: 241684

This is essentially a crosstab report, with the rows = key and column =
book_title and values = book_title.

--
Terry Dykstra (TeamPS)
Canadian Forest Oil Ltd.

Kaye Hendry wrote in message <365C3928.7866@healthinsight.org>...
>In InfoMaker SQL can you take a table with multiple
>rows for the same key and take a column from the
>rows and create mutiple columns with one
>report line with the key(no duplicate keys) on a report? For example
>
>Table books
>(key) (book title)
>123 misery
>123 titanic
>123 roots
>456 war
>456 1984
>456 giant
>
>The report I need would look like this
>
>Key title1 title2 title 3
>123 misery titanic roots
>456 war 1984 giant
>
>Thanks in advance.
>--
> Kaye Hendry
> HealthInsight
> email:kaye.hendry@healthinsight.org


Kaye Hendry Posted on 1998-11-25 20:57:29.0Z
Newsgroups: sybase.public.infomaker.general
Date: Wed, 25 Nov 1998 13:57:29 -0700
From: Kaye Hendry <kaye.hendry@healthinsight.org>
Organization: HealthInsight
X-Mailer: Mozilla 3.04 (Win95; I)
MIME-Version: 1.0
Subject: Re: mutiple rows one column to multiple columns one row
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 32
Message-ID: <348_365C6F39.31B2@healthinsight.org>
References: <348_365C3928.7866@healthinsight.org> <348_4iNwB6JG#GA.159@forums.powersoft.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6699
Article PK: 241686

I will try the crosstabs, but I am wondering if you can
write SQL code so you could use the "rows save as" option
to write out to a spreadsheet or use the code to pipeline
to a table or view. Thanks in advance.

Terry Dykstra wrote:

>
> This is essentially a crosstab report, with the rows = key and column =
> book_title and values = book_title.
>
> --
> Terry Dykstra (TeamPS)
> Canadian Forest Oil Ltd.
> Kaye Hendry wrote in message <365C3928.7866@healthinsight.org>...
> >In InfoMaker SQL can you take a table with multiple
> >rows for the same key and take a column from the
> >rows and create mutiple columns with one
> >report line with the key(no duplicate keys) on a report? For example
> >
> >Table books
> >(key) (book title)
> >123 misery
> >123 titanic
> >123 roots
> >456 war
> >456 1984
> >456 giant
> >
> >The report I need would look like this
> >
> >Key title1 title2 title 3
> >123 misery titanic roots
> >456 war 1984 giant
> >
> >Thanks in advance.
> >--
> > Kaye Hendry
> > HealthInsight
> > email:kaye.hendry@healthinsight.org

--
Kaye Hendry
HealthInsight
email:kaye.hendry@healthinsight.org


Terry Dykstra Posted on 1998-11-26 15:56:45.0Z
Newsgroups: sybase.public.infomaker.general
From: "Terry Dykstra" <tdykstra@cfol.ab.ca>
Subject: Re: mutiple rows one column to multiple columns one row
Date: Thu, 26 Nov 1998 08:56:45 -0700
Lines: 56
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <348_KGqwStUG#GA.161@forums.powersoft.com>
References: <348_365C3928.7866@healthinsight.org> <348_4iNwB6JG#GA.159@forums.powersoft.com> <348_365C6F39.31B2@healthinsight.org>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.infomaker.general:6698
Article PK: 241683

If you use SQLAnywhere, you might be able to use the list() function.
Otherwise you will have to write some kind of stored procedure to get the
desired result.
If you can make the crosstab static, you can use the 'rows save as'.

--
Terry Dykstra (TeamPS)
Canadian Forest Oil Ltd.

Kaye Hendry wrote in message <365C6F39.31B2@healthinsight.org>...
>I will try the crosstabs, but I am wondering if you can
>write SQL code so you could use the "rows save as" option
>to write out to a spreadsheet or use the code to pipeline
>to a table or view. Thanks in advance.
>
>Terry Dykstra wrote:
>
>>
>> This is essentially a crosstab report, with the rows = key and column =
>> book_title and values = book_title.
>>
>> --
>> Terry Dykstra (TeamPS)
>> Canadian Forest Oil Ltd.
>> Kaye Hendry wrote in message <365C3928.7866@healthinsight.org>...
>> >In InfoMaker SQL can you take a table with multiple
>> >rows for the same key and take a column from the
>> >rows and create mutiple columns with one
>> >report line with the key(no duplicate keys) on a report? For example
>> >
>> >Table books
>> >(key) (book title)
>> >123 misery
>> >123 titanic
>> >123 roots
>> >456 war
>> >456 1984
>> >456 giant
>> >
>> >The report I need would look like this
>> >
>> >Key title1 title2 title 3
>> >123 misery titanic roots
>> >456 war 1984 giant
>> >
>> >Thanks in advance.
>> >--
>> > Kaye Hendry
>> > HealthInsight
>> > email:kaye.hendry@healthinsight.org
>
>--
> Kaye Hendry
> HealthInsight
> email:kaye.hendry@healthinsight.org