|
|
Archives of the TeradataForum
Message Posted: Fri, 01 Jul 2005 @ 20:54:48 GMT
Subj: | | Re: SQL to flattening a table |
|
From: | | Christian Schiefer, makeITdone |
Hi,
what about windowing OLAP functions:
select cust_no
, max( acc_no ) over ( partition by cust_no order by acc_no asc
rows between 1 following and 1 following )
as acc_one
, max( acc_no ) over ( partition by cust_no order by acc_no asc
rows between 1 following and 1 following )
as acc_two
, max( acc_no ) over ( partition by cust_no order by acc_no asc
rows between 1 following and 1 following )
as acc_three
from ...
Greetings
Christian
| |