Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

counting slaries using query

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
In my Employee table I have name and salary fields count of employees is 500. I want to count all employees salaries. Is there any way to coount using query.Can any one tell me how to achieve this.

regards,
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are 500 employees then there are 500 salaries, no?

Or is there some other meaning for the requirement "to count employees' salaries"?
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi paul,

thanks for your reply,

I want to count salaries of employees.each employee is having different salary grade.

regards,
vardhan
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See,

I am assuming that employees will having grades like A, B C

now to count employees with grade A you need to fire query such as :



now to count employees with grade B you need to fire query such as :



now to count employees with grade C you need to fire query such as :





 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
soni,

don't bother about grades,

grades what ever it may be. I want to count all employees salaries at finally I want to display one figure (Ex: 2,45,89,000 this is the figure of all employees salary amount)

regards,
vardhan
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, got it, you want total that is the sum of all salaries, then you can do something like this



is this what you want to do ??
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot soni,

I got exact what i am looking. I forgot this aggregate functions.

once again thanks.
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic