如何在ORACLE中的查询中重命名列 [英] How to rename a column in a query in ORACLE
本文介绍了如何在ORACLE中的查询中重命名列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此查询对更改employees表中列的名称是否正确:
Is this query right for changing the name of a column in the employees table:
select first_name, rename_column('first_name' to 'empName') from employees;
推荐答案
有两种方法 1)为列指定别名
there are two ways 1) give alias name to the column
SELECT first_name AS emp_name
FROM employee;
2)更改列名
alter table employee
rename first_name to emp_name ;
这篇关于如何在ORACLE中的查询中重命名列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文