• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Query and sub query question in Oracle SQL.

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to look into using "group by", "order by" and "count(*)".
 
reply
    Bookmark Topic Watch Topic
  • New Topic