Thread: How to write an query to get this result?

How to write an query to get this result?

From
"Daniel Dunajsky"
Date:
Hello,

Is there any way how to retrieve result normally displayed as:

TOTAL             268
Administrator     7
Internet Only      178
Filtered Internet  7

To be like this:

TOTAL Administrator Internet Only Filtered Internet
268        7                   178               7

That means, the rows of the first column of the first case are headers in 
the second case. Similarly, the rows of the second column are displayed as 
one row.

Please reply to daniel_katka@hotmail.com

Thank you very much.

Daniel



Re: How to write an query to get this result?

From
Richard Huxton
Date:
On Thursday 01 May 2003 4:07 am, Daniel Dunajsky wrote:
> Hello,
>
> Is there any way how to retrieve result normally displayed as:
>
> TOTAL             268
> Administrator     7
> Internet Only      178
> Filtered Internet  7
>
> To be like this:
>
> TOTAL Administrator Internet Only Filtered Internet
> 268        7                   178               7
>
> That means, the rows of the first column of the first case are headers in
> the second case. Similarly, the rows of the second column are displayed as
> one row.

There are some crosstab-style functions in the contrib directory in source.
Can't remember where, sorry. Look for something like "cross-tab" or try the
table-function examples.

--  Richard Huxton