Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sfalalu
Starting Member
7 Posts |
Posted - 2014-06-03 : 08:04:05
|
Simplify the following tasks:? Calculation of the total cost for a particular order? Calculation of the total of all the orders placed by a particular employee in a particular monthNiit |
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2014-06-03 : 10:20:34
|
We need some sample data, fields...basically its this kind of query:----Calculation of the total cost for a particular orderSelect Count(OrderCost) as TotalOrderCostFrom dbo.OrdersWhere CustomerName = 'ABC'Go--Calculation of the total of all the orders placed by a particular employee in a particular monthSelect Count(a.[OrderCost]) as TotalEmployeeOrderCost, Month(OrderDate) as MonthNumFrom dbo.Orders aInner Join dbo.Employees eOn a.OrdersID = e.EmployeeIDWhere e.[Employee] = 'John Doe'and MonthNum = 6 -- 6 for JuneGoWe are the creators of our own reality! |
|
|
sfalalu
Starting Member
7 Posts |
Posted - 2014-06-04 : 07:45:49
|
thanks guyNiit |
|
|
sfalalu
Starting Member
7 Posts |
Posted - 2014-06-05 : 07:11:35
|
I was told to create trigger using the same queryNiit |
|
|
|
|
|