Simple Oracle Query

Status
Not open for further replies.

DukeNukem

Come get Some
Hye There

Can any of you help me with this

Create query that displays the employees last names and indicates the amounts of their annual salaries with asterisks. Each asterisk signifies a thousand dollars. Sort the data in descending order of salary. Label the column EMPLOYEES_AND_THEIR_SALARIES.
 

wizrulz

GUNNING DOWN TEAMS
select rpad(last_name,8 )||' '||RPAD(' ',salary/1000+1,'*') EMPLOYEES_AND_THEIR_SALARIES

From employee
order by salary DESC;


I THINK U GOT UR ANS ;)
__________
Did u genuinely had problem with this...as i feel u knew the ans and just wanted to check out members oracle knowledge.....
 
Last edited:

wizrulz

GUNNING DOWN TEAMS
yeah thats true...but to make it easy to understand if he really had problem......i used it other way around.... ;)
 

binayak_oracle

Right off the assembly line
Can you please explain!

Hi Friends,

Can you please explain why the RPAD 1st argument is simply space and why 1 is added to the salary after it is divided by 1000?

Thanks in advance!
 
Status
Not open for further replies.
Top Bottom