Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Transpose in SQL

Re: Transpose in SQL

From: Bret Halford <bret_at_sybase.com>
Date: 1998/10/16
Message-ID: <36276A85.4309@sybase.com>#1/1

Ng K C Paul wrote:
>
> Is it possible to do the Transpose function using SQL like under Excel's
> Paste Special - change columns of data to rows, and vice versa?

Yes. In general, this is called a "table pivot"

A technique to perform it is explained in the book "Optimizing Transact-SQL: Advanced Programming Techniques" by Rozenshtein, Abramovich, and Birger, SQL Forum Press (http://www.sqlforum.com). Highly recommended.

You can also search for "~g comp.databases.sybase pivot" at http://www.dejanews.com to see an example I posted earlier this year.

-- 
Bret Halford			Imagine my disappointment
Sybase Technical Support	in learning the true nature		
3665 Discovery Drive		of rec.humor.oracle...
Boulder, CO 80303
Received on Fri Oct 16 1998 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US