Archives of the TeradataForum
Message Posted: Wed, 04 Jan 2006 @ 14:16:05 GMT
Subj: | | Re: OLAP Function MAX with VARCHAR issue |
|
From: | | Dieter Noeth |
Madhan Kumar Munipandian wrote:
| Req : To convert Rows into Columns for CHAR Attribute | |
There was no syntax error message, when you submitted above query? I've never seen "ALL(....) = 1", what's the expected result?
Btw, rows to columns is usually done using Group By:
SELECT
p.party_id
,MAX(CASE WHEN PD.DEMOG_CD ='STATUS1' THEN DEMOG_VALUE_CD END) STATUS1
,MAX(CASE WHEN PD.DEMOG_CD ='STATUS2' THEN DEMOG_VALUE_CD END) STATUS2
, ...
FROM DDEDWMIG_SBDW.PARTY P
INNER JOIN DDEDWMIG_SBDW.PARTY_DEMOGRAPHIC PD
ON P.PARTY_ID = PD.PARTY_ID
GROUP BY p.party_id
Dieter
|