ORA-00998: must name this expression with a column alias

问题描述:创建视图时报错ORA-00998,如下所示:
SQL> create view v_emp80
2 as select employee_id,first_name || ' ' || last_name,salary,department_id
3 from employees
4 where department_id=80;

as select employee_id,first_name || ' ' || last_name,salary,department_id
*
ERROR at line 2:
ORA-00998: must name this expression with a column alias

异常原因:创建视图时,达式需要别名,才能作为视图的列名,否则会报错.
添加别名后成功创建视图.
SQL> create view v_emp80
2 as select employee_id,first_name || ' ' || last_name name,salary,department_id
3 from employees
4 where department_id=80;

View created.