aspose file tools*
The moose likes JDBC and the fly likes counting slaries using query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "counting slaries using query" Watch "counting slaries using query" New topic
Author

counting slaries using query

Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
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
Bartender

Joined: Oct 14, 2005
Posts: 18129
    
    8

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

Joined: Dec 21, 2006
Posts: 197
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

Joined: Mar 28, 2007
Posts: 403
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 :






Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
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

Joined: Mar 28, 2007
Posts: 403
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

Joined: Dec 21, 2006
Posts: 197
thanks a lot soni,

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

once again thanks.
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Cool
 
 
subject: counting slaries using query
 
Similar Threads
Problem in pager tab lib
Impossible XPath???
Error While Creating Materialized View
Duplicate Characters
Action class in Struts