Sunday, February 19, 2012

How to do calculation in Stored Procedure

Hi All,

Can anyone show me how to do a calculation in stored procedure? What I want to achieve is:
Employee has a different commission on each order, but what I would like to get is the total commission for all the orders that he/she accomplished so far.
Can anyone help me to write a query for this?

Thanks in advance.

Anyone please...|||

Try something like this:

SELECT EmployeeID, SUM(Commission) AS TotalCommission FROM yourOrderTable

GROUP BY EmployeeID

|||Thanks, I got it. I was thinking too complicated.

No comments:

Post a Comment