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 |
sharath_ms
Starting Member
3 Posts |
Posted - 2013-03-13 : 09:53:07
|
Hi All-I'm learning OLAP modelling.In this context i have decided to use northwind database for creating Star schema.I want to select the below fields using Northwind database,these fields will be used to create Order fact table.OrderID,ProductID,UnitPrice,Quantity,Discount,Customer ID,Employee ID,Supplier and Order Date.I tried querying using the below query.However,as am not good at SQL i'm unable to fine tune this query.SELECT distincto.OrderID,od.Quantity,od.UnitPrice,e.EmployeeID,p.ProductIDs.SupplierIDfrom [Order Details] od inner join Orders o on od.OrderID=o.OrderID , Employees e JOIN Orders ON (e.EmployeeID = Orders.EmployeeID), Products p JOIN Suppliers ON (p.ProductID= Suppliers.SupplierID) Suppliers S JOIN Products ON (S.SupplierID = Products.SupplierID).Can someone provide me correct query to pull the above mentioned field.Thanks for your help in advance.RegardsSSM |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2013-03-13 : 14:29:05
|
I don't have the Northwind database but I'm guessing you want something like this for your FROM clause. from orders oinner join orderDetails od on od.orderid = o.orderidinner join products p on p.productid = od.productidinner join suppliers s on s.supplierid = p.supplieridinner join Employees e on e.EmployeeID = o.EmployeeID Be One with the OptimizerTG |
|
|
sharath_ms
Starting Member
3 Posts |
Posted - 2013-03-14 : 09:11:50
|
Thanks for help |
|
|
|
|
|
|
|