• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

counting slaries using query

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool
 
Die Fledermaus does not fear such a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic