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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 join tables

Author  Topic 

thanksfor help
Posting Yak Master

106 Posts

Posted - 2006-06-15 : 19:07:09
Hi,

I have 3 tables, here is sample of them



Table A :Table_Sales(

prodId,
amt,
qty,
siteId
)


Table A :Table_Mfgcost(
mfgId,
cost1,
cost2
)

Tbale C:Table_SalesMfgCostMapped
(
tbl_ID,
ProdId,
mfgId)


Table C is N:N relationship.
Please help me in
Selecting everything from Table A and B by joining Table C.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-06-15 : 19:18:37
Here is an example where Table2 is the junction table.

SELECT ...
FROM Table1 t1
INNER JOIN Table2 t2
ON t1.SomeColumn = t2.SomeColumn
INNER JOIN Table3 t3
ON t2.SomeOtherColumn = t3.SomeOtherColumn

I didn't post the exact solution as you didn't post what you had so far, so I'm thinking that this is homework.

Tara Kizer
aka tduggan
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-16 : 02:29:02
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
Go to Top of Page
   

- Advertisement -