Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Transpose in SQL
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 80303Received on Fri Oct 16 1998 - 00:00:00 CDT