|
|
Archives of the TeradataForum
Message Posted: Fri, 24 Jun 2005 @ 20:41:37 GMT
Subj: | | Re: SQL to flattening a table |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Friday, June 24, 2005 16:18 -->
Maybe something like this would work for you.
select a . cust , a . acct , a . bal , b . acct , b . bal , c . acct , c
.
bal , d . acct , d . bal
from (select cust , acct , bal from tbl1 where acct = 100 ) a
left join ( select cust , acct , bal from tbl1 where acct = 200 ) b
on a . cust = b . cust
left join ( select cust , acct , bal from tbl1 where acct = 300 ) c
on a . cust = c . cust
left join ( select cust , acct , bal from tbl1 where acct = 400 ) d
on a . cust = d . cust
Regards
| |