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;
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;
there are two ways 1) give alias name to the column
SELECT first_name AS emp_name
FROM employee;
2) change column name
alter table employee
rename first_name to emp_name ;
To set an alias for a field use the following:
SELECT first_name AS "empName", hire_date AS "Tenure On December 31 2014"
FROM employees;
If you are going to change the name just in your current result-set, you can do following:
select first_name AS emp_name from employees;
if you are going to change the name permanently, you have to work with ALTER TABLE:
ALTER TABLE employees CHANGE first_name emp_name VARCHAR2(255);