Oracle Query - help

Why the following code not work -invalid identifier  on documentation_level_desc .


 


SELECT  TO_NUMBER (l.loan_number) AS srvcnum,


         l.product_type_id AS cmdm_Market_Type_num,


        


         (SELECT documentation_level_desc


            FROM CMDMmgr.documentation_level_type d


           WHERE o.documentation_level_id = d.documentation_level_id)


            AS cmdm_doc_type,


           


         (SELECT SPECIAL_FEATURE_CODE


            FROM CMDMmgr.SPECIAL_FEATURE sf


           WHERE TO_NUMBER (lsf.SPECIAL_FEATURE_ID) = sf.SPECIAL_FEATURE_ID)


            AS Harp_CODE


           


    FROM CMDMmgr.loan l


         LEFT JOIN CMDMmgr.loan_origination o


            ON l.loan_number = o.loan_number


         LEFT JOIN CMDMmgr.LOAN_SPECIAL_FEATURE lsf


            ON l.loan_number = lsf.loan_number


   WHERE (product_type_id in (103, 104, 108, 116, 117, 119, 123,


                                                                                    731, 732, 733, 734, 735, 737, 738, 739)


                                                or documentation_level_desc in ('Signature NCO New Value' 'Signature NCO Orig Value')


                                                or SPECIAL_FEATURE_CODE in ('X908' 'T746' 'T786' 'T839' 'T840')


                )

所有跟帖: 

Add a 逗号 in the in clause of last two lines. -美国老土- 给 美国老土 发送悄悄话 美国老土 的博客首页 (0 bytes) () 08/08/2012 postreply 14:00:10

回复:still not working -Risk- 给 Risk 发送悄悄话 (30174 bytes) () 08/08/2012 postreply 14:16:38

put table name in front of -gchai- 给 gchai 发送悄悄话 gchai 的博客首页 (772 bytes) () 08/08/2012 postreply 15:12:38

先看一下这个 -安心草- 给 安心草 发送悄悄话 安心草 的博客首页 (2611 bytes) () 08/08/2012 postreply 15:24:24

你所指代的 o and lsf 分别在这两个 -JJGL- 给 JJGL 发送悄悄话 (6629 bytes) () 08/08/2012 postreply 16:50:20

o, lsf没有问题,是main query的两个table alias. 问题出在 -布衣之才- 给 布衣之才 发送悄悄话 布衣之才 的博客首页 (428 bytes) () 08/08/2012 postreply 20:09:14

回复:Oracle Query - help -nopanic- 给 nopanic 发送悄悄话 (1104 bytes) () 08/08/2012 postreply 18:49:54

回复:Oracle Query - help -花心野趣- 给 花心野趣 发送悄悄话 花心野趣 的博客首页 (20609 bytes) () 08/08/2012 postreply 19:01:24

为啥不都用join呢? -smile2- 给 smile2 发送悄悄话 (2538 bytes) () 08/08/2012 postreply 19:36:05

回复:Oracle Query - help -布衣之才- 给 布衣之才 发送悄悄话 布衣之才 的博客首页 (25703 bytes) () 08/08/2012 postreply 20:12:35

the issues of the query -ffppyy- 给 ffppyy 发送悄悄话 (1467 bytes) () 08/08/2012 postreply 22:15:23

2nd line from last, need d.documentation_level_desc since your ' -kamioka- 给 kamioka 发送悄悄话 kamioka 的博客首页 (0 bytes) () 08/09/2012 postreply 16:18:34

since your 'from' is file l but documentation_level_desc is from -Kamioka- 给 Kamioka 发送悄悄话 Kamioka 的博客首页 (0 bytes) () 08/09/2012 postreply 16:21:02

documentation_level_desc is from d. also need sf. in front of th -Kamioka- 给 Kamioka 发送悄悄话 Kamioka 的博客首页 (0 bytes) () 08/09/2012 postreply 16:22:52

also need sf. in front of the variable in last line. -Kamioka- 给 Kamioka 发送悄悄话 Kamioka 的博客首页 (0 bytes) () 08/09/2012 postreply 16:24:09

请您先登陆,再发跟帖!