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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-07-09 : 10:57:05
|
| Mandar writes "Hi Experts,I have 3 master tables :PR_Mast : PR_NO, PR_DESCType_Mast: Type_No, Type_DescCOB_Mast: COB_No, COB_Descand a relational table :PR_COB_REL : PR_NO, Type_No, COB_Nothe relationship within all 3 is many to many.i have designed a query to select specific COB_No as followsselect COB_No from PR_COB_REL where PR_NO='P1' and Type_No='T1'The output is suppose:C1C2C3C6now i want to design a query where i want to select the COB_Nos other than the above mentioned output from the table COB_Mast.how should i make the join? Plz explain.Regards" |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-07-09 : 12:23:17
|
| If I understand correctly,select a.COB_No, c.COB_Desc from PR_COB_REL a join COB_Mast con a.COB_No = c.COB_Nowhere not exists (select COB_No from PR_COB_REL bwhere a.COB_No = b.COB_No and PR_NO='P1' and Type_No='T1') |
 |
|
|
|
|
|