为什么视图没有创建?

时间:2014-01-27 07:17:50

标签: oracle

create or replace view V_SBI_CLM_LOSSCAUSE 
AS select loss_cause_code, distinct loss_cause_name, 
   product_line_code, loss_cause_desc, event_id 
   from t_clm_losscause; 

当我试图让我得到

  

缺少表达

任何人请帮助..提前感谢

2 个答案:

答案 0 :(得分:1)

您需要在DISTINCT之前加上SELECT关键字。 DISTINCT关键字应适用于所有选定的列。

CREATE OR REPLACE VIEW v_sbi_clm_losscause 
     AS SELECT DISTINCT
               loss_cause_code, 
               loss_cause_name, 
               product_line_code, 
               loss_cause_desc, event_id 
        FROM   t_clm_losscause; 

答案 1 :(得分:0)

试试这个。

 create or replace view V_SBI_CLM_LOSSCAUSE 
 AS select distinct loss_cause_name, 
 product_line_code, loss_cause_desc, event_id 
 from t_clm_losscause;