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 |
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2006-04-02 : 08:19:43
|
| I have a table names Product_1 and Product_2but in these tables there are products that have same ProductIDi want to get the Product_2's products that doenst exists on Product_1so which query must i use ?right join or else ?MS BLESS US |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-04-02 : 08:48:26
|
will this do?select t2.*from Product_2 t2 left join Product_1 t1 on t1.ProductID = t2.ProductIDwhere t1.ProductID is null Go with the flow & have fun! Else fight the flow Blog thingie: [URL="http://weblogs.sqlteam.com/mladenp"] |
 |
|
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2006-04-02 : 09:00:42
|
| ok man :D thx very much that query is what i wantMS BLESS US |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-03 : 02:28:10
|
| Other methodSelect * from Product_2 P2 where not exists(select * from Product_1 where Product_id=P2.Product_id)MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|