0

这是我用来在 Toad 中创建视图的脚本

CREATE VIEW INTERN_VIEW AS
 SELECT SPRIDEN_ID, SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME, SYRISCH_COM_ID
      , SYRINCP_COM_NAME, SYRISCH_STATUS_CODE --,    
      , min(SYRISCH_CH_NUM)    
   FROM SYRISCH, SINSPL_CUSTOM.SPRIDEN ,SYRINCP    
  Where SYRISCH_STATUS_CODE = 'PE'    
    and spriden_change_ind is null    
    and SPRIDEN_PIDM = SYRISCH_PIDM    
    and SYRINCP_COM_ID = SYRISCH_COM_ID    
  group by SPRIDEN_ID, SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME
         , SYRISCH_COM_ID, SYRINCP_COM_NAME, SYRISCH_STATUS_CODE

我收到一条错误消息

“ORA-00998:必须使用列别名命名此表达式”。

4

1 回答 1

2

您必须min(SYRISCH_CH_NUM)按以下方式命名

SELECT SPRIDEN_ID, SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME, SYRISCH_COM_ID, SYRINCP_COM_NAME, SYRISCH_STATUS_CODE--,    
,min(SYRISCH_CH_NUM) as SYRISCH_CH_NUM   
FROM SYRISCH, SINSPL_CUSTOM.SPRIDEN ,SYRINCP    
Where SYRISCH_STATUS_CODE = 'PE'    
and spriden_change_ind is null    
and SPRIDEN_PIDM = SYRISCH_PIDM    
and SYRINCP_COM_ID = SYRISCH_COM_ID    
group by SPRIDEN_ID, SPRIDEN_FIRST_NAME, SPRIDEN_LAST_NAME, SYRISCH_COM_ID, SYRINCP_COM_NAME, SYRISCH_STATUS_CODE
于 2013-05-14T10:59:58.257 回答