功能如何使用案例

时间:2019-03-07 13:44:50

标签: sql

当我使用如下功能时,如何排除此代码; 如果功能正常,我可以使用'from'吗?

          SPRIDEN_ID NOT IN ((SIBINST_TERM=
             (select max(SIBINST_TERM)
                       from sibinst
                       where SIBINST_TERM<'201920'
                              and sibinst_id=spriden_id)
                 and SIBINST_FCS='AC' 
             ))

我想在下面的代码中放这个,但这给了错误 从说特派团右偏瘫

select  distinct 
       spriden_last,        
        case WHEN  (SPRIDEN_ID IN (SELECT SGBSTDN_ID FROM SGBSTDN) AND 
                    SPRIDEN_ID NOT IN ((SIBINST_TERM=
             (select max(SIBINST_TERM)
                       from sibinst
                       where SIBINST_TERM<'201920'
                              and sibinst_id=spriden_id)
                 and SIBINST_FCS='AC' 
             )))
                    THEN 'S'      END AS FF        
   FROM SPRIDEN,SIBINST
   WHERE spriden_id=sibinst_id     ;

0 个答案:

没有答案