sql - Oracle query return ORA-00923: FROM keyword not found where expected -


i trying execute sql query facing error "ora-00923: keyword not found expected"

 select count(distinct c.pdc_loan_id)     cr_loan_dtl           join cr_pdc_instrument_dtl c            on(a.loan_id=c.pdc_loan_id , a.loan_branch='1')         join gcd_customer_m f            on(f.customer_id = a.loan_customer_id)          left outer join ( select main.pdc_loan_id,user.user_name                                (select max(b.pdc_instrument_id)id,                                          a.pdc_loan_id ,                                          b.maker_id                                     cr_pdc_instrument_dtl                                           join  cr_pdc_hold_reason_dtl b                                                        on(a.pdc_instrument_id=b.pdc_instrument_id ,                                               b.to_status='h' ,                                                                                                                         b.hold_reason_status='h' ,                                                b.main_status='f')                                      group a.pdc_loan_id )main                                  join sec_user_m user                                    on(user.user_id=main.maker_id)) tab             on(tab.pdc_loan_id=a.loan_id)   c.pdc_status in ('a','h')         , c.pdc_purpose='installment'       , c.pdc_loan_id='93157'      , f.customer_name '%abab%'; 

i think have problem below query.

select max (b.pdc_instrument_id) id, a.pdc_loan_id, b.maker_id     cr_pdc_instrument_dtl join cr_pdc_hold_reason_dtl b          on (a.pdc_instrument_id = b.pdc_instrument_id              , b.to_status = 'h'              , b.hold_reason_status = 'h'              , b.main_status = 'f'             ) group a.pdc_loan_id 

here need add b.maker_id group clause.


Comments