puretppc
puretppc

Reputation: 3292

Why is my SQL statement displaying the function name?

So I tried this statement to print all last names in uppercase but this is what I got:

UPPER(LAST
----------
BROWN
KERN
HOFFMAN

My statement was to print the last names of all employees who's credit_limit was greater than 25 in uppercase.

select UPPER(last_name) from employees where credit_limit>25;

I tried the UPPER function but it printed the function and its brackets as well. I want to make it so that it prints this instead:

LAST_NAME
----------
BROWN
KERN
HOFFMAN

I tried normally printing it as if the credit_limit was greater than 25 (without uppercases and I got it the way I wanted it.

select last_name from employees where credit_limit>25;

Upvotes: 0

Views: 55

Answers (1)

Rahul
Rahul

Reputation: 77896

That's because you haven't use any column alias for display purpose and so it's using the function name as such. Use a column alias you want to display like

select UPPER(last_name) as Last_Name_In_UpperCase
from employees 
where credit_limit > 25;

Upvotes: 3

Related Questions