Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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(*)".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic