sql query for many to many relationship

Posted by Parthibansk under Sql Server on 8/7/2012 | Points: 10 | Views : 1140 | Status : [Member] | Replies : 3
need sql query for many to many relationship with example




Responses

Posted by: Pandians on: 8/7/2012 [Member] [MVP] Silver | Points: 25

Up
0
Down
Kindly post your requirement/question more clear!

Do you need query to Create relationship tables' script
(or)
Do you need query to JOIN multiple tables

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sriramnandha on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down

select * from tablename inner join tablename2 on

tablename.columnname=tablename2.columnname



sriram

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 9/4/2012 [Member] Bronze | Points: 25

Up
0
Down
SELECT sd.CustomerID, si.DiscountAmt, cp.ProductName
FROM dbo.SalesInvoiceDetail sd
INNER JOIN CurrentProducts AS cp
ON cp.ProductID = sd.ProductID
WHERE si.CustomerID= 490

Parthibansk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response