Re: How can you create a flatten table in SQL

From: Dave <jazmanius_at_my-deja.com>
Date: Tue, 30 Nov 1999 11:41:44 GMT
Message-ID: <820d5o$8j2$1_at_nnrp1.deja.com>


SQL is just a tool to grab data; to format it you need a separate program. What you are asking shouldn't be too difficult to do, say, in Perl or C. Which can of course call the SQL to grab the input data in the first place.

In article <383C36B8.1DCC7E9_at_dee.wellesley.edu>,   jpearson_at_dee.wellesley.edu wrote:
> Hi,
>
> Is there a way to create a flattened table in SQL using
> such data as this:
>
> id type suff
>
> 12 3 0
> 12 3 0
> 12 4 1
> 12 4 1
> 12 4 1
> 12 4 1
> 12 5 2
> 12 5 2
> 12 5 2
>
> select id||'-'||type||'-'||suff,
> ?
> from pop
> ?
>
> output would be:
>
> field1 field2 field3
> 12-3-0 12-4-1 12-5-2
>
> thanks in advance for any ideas
>
> j
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Nov 30 1999 - 12:41:44 CET

Original text of this message