• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query and sub query question in Oracle SQL.

 
John King
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Employee table in Oracle. It has all the employees and their salaries listed. The Employee table has following columns:

Employee_ID as PK
Employee_Name
Salary
...

I need to create a query that list the salaries in desc order with the employee count with each of the salaries. I think I need to
get the distinct salaries first in a sub query and then get the counts... Thanks for any helps.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to look into using "group by", "order by" and "count(*)".
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!