0

Dear All,
I am beginners in MS Sql, now I have three tables (Companies, Product, SaleBody). and their fields are
(CompanyId, CompanyName), (ProductId, ProductName, CompanyId, PurchaseSTPrice, TradePrice), (SerialNo, SaleId, ProductId, Quantity, Price, TotalPrice)..............
I want to create Report in which I want (companies.CompanyName, product.ProductName, product.TradePrice, salbody.TotalPrice)

     How can I get these fields from 3 tables. 

     I am very thankful to you all..... 

     and wait for your reply
3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by JorgeM
0
SELECT c.CompanyName, p.ProductName, p.TradePrice, s.TotalPrice
FROM Companies c, Product p, SaleBody s
WHERE c.CompanyId = p.CompanyId
AND p.ProductId = s.ProductId

Edited by pritaeas

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.