|
|
Archives of the TeradataForum
Message Posted: Tue, 31 Aug 2004 @ 15:40:00 GMT
Subj: | | Subquery in where condition |
|
From: | | Patel,Harshida S |
Select a.pol_key
,a.cust_key
,
Case
When a.ctl_St_cd = 'KY' THEN
(
CASE
WHEN b.cv_DESC IN ('BIPD', 'BI', 'APIP') THEN
(
Select DISTINCT d.cv_opt
From d3141apm.pol_vh_cv_fct c
,d3141apm.cv_dim d
Where c.pol_key = a.pol_key
And c.cust_key = a.cust_key
And c.cv_key = a.cv_key
And d.cv_key = a.cv_key
And d.cv_desc= 'PIP')
ELSE ' ' END)
ELSE
' '
END
FROM D3141APM.POL_VH_CV_FCT A
,D3141APM.CV_DIM B
WHERE
A.CV_KEY = B.CV_KEY
AND A.CTL_ST_CD = 'KY'
I get an error expected something between '(' and select.
Suggestions would be appreciated.
| |