Query Help! | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Query Help!

Hi Team, Please help me with the query for this particular problem:
I need to get the total commission for employees based on the orders that they already completed. Each order has different commission percentage. How I can get the result set which are include Employee Name, Commission Total, and Order Total. Thanks in advance.
You are not giving any details. We can’t go guessing what you’re trying to do.<br /><br />And we can’t do your homework for you.[}<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][V]
I’m sorry for being not clear in my thread. However, I already figure that out. First, I was thinking to complicated about calculated the commission by doing loop, actually, it’s just simply calling a sum function. This is what I did: SELECT SUM(TotalCommission) as TotalCommission FROM Employee Group By EmployeeID Thanks.
Excellent!
Learn SQL http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Madhivanan Failing to plan is Planning to fail
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Adriaan</i><br /><br />Excellent!<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />[<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />]
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by ranjitjain</i><br /><br /><blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Adriaan</i><br /><br />Excellent!<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />[<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />][<img src=’/community/emoticons/emotion-2.gif’ alt=’:D‘ />]<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br />Everybody was a beginner at some point in time. There is nothing wrong with it. [<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]<br /><br />–<br />Frank Kalis<br />Moderator<br />Microsoft SQL Server MVP<br />Webmaster:<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a>
Thats why I suggested the questioner to learn Basic SQL [<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
]]>