Teradata - Query error 3707 [message #131295] |
Fri, 05 August 2005 03:41 |
Nelsonmak
Messages: 2 Registered: August 2005 Location: Randburg
|
Junior Member |
|
|
Can anyone assist me with the query below.I get error 3707: Syntax error,expected something like an 'END'keyword between a string and the 'case'keyword.
select A.part_id,
case when B.noofdisconnects > 6
then 'L'
else B.noofdisconnects <=6
then 'M'
elseif B.noofdisconnects = 0
then 'H'
end Segment
from mcaedw.participant A
left outer join
(select part_id , count(svce_agree_status_type_id) noofdisconnects
from mcaedw.service_Agreement_Status where mpartner_id = 'MCA_ZAM' and svce_agree_Status_Type_id in ('D','C')
and svce_agree_Status_Chng_date between '2004-08-01' and '2005-08-01'
group by part_id) B
on A.part_id = B.part_id
where A.mpartner_id = 'MCA_ZAM'
The query will only work if I put this in my case when B.noofdisconnects > 6
then 'L'
else 'M'
|
|
|