-1

While using nvl function i just tried experimenting by adding alias name to column to which nvl is applied but encountered error message .

select  nvl(commission_pact,0) commission_pact AS "COMM"
FROM employees;

but i am getting error message as :-

`FROM keyword not found where expected

Where is the problem in syntax?

1 Answers1

3

You are providing two aliases. The second commission_pact is already a column alias. Just remove that:

select nvl(commission_pact,0) AS "COMM"
FROM employees;

alternatively

select nvl(commission_pact,0) commission_pact
FROM employees;

or

select nvl(commission_pact,0) as commission_pact
FROM employees;