oracle - SQL - missing keyword in case when syntax -
i getting error message
missing keyword
any suggestions?
case when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=0 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 4000 'asset' else case when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=4000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 8000 'liability' else case when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=8000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 9000 'off balance sheet asset' else case when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=9000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 10000 'off balance sheet liability' end asset_type,
i think using more "case" word in case statement. remove "else case" after each "then". refer oracle documentation
case when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=0 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 4000 'asset' when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=4000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 8000 'liability' when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=8000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 9000 'off balance sheet asset' when substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4)>=9000 , substr(m1.m_gl_line_no,length(m1.m_gl_line_no - 4),4) < 10000 'off balance sheet liability' end asset_type,
the general syntax be
case when col = 1 'active' when col = 2 'inactive' when col = 3 'terminated' end statustext
Comments
Post a Comment