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 |
Keshaba
Yak Posting Veteran
52 Posts |
Posted - 2008-01-03 : 07:44:12
|
I want to write a query Comapring 3 tables named TabFittingDetals,TyreFittingDetails,and TabInventory.I want to load only those tyreno which is present in TabFittingDetails But not in TyreFittingDetails and TabInventory.With 2 tables I had written like this"select ItemCode,TyreNo from TyreIssueDetails where vehno = 'AS063388' and ItemCode = 'Tyre' And TyreIssueDetails.TyreNo Not in (select TyreNo from TabFittingDetails)"Keshab |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-01-03 : 07:53:36
|
[code]Select ...From TabFittingDetails t1 LEFT JOIN (Select tyreno from TyreFittingDetails union all Select tyreno from TabInventory) t2on t1.tyreno = t2.tyreno where t2.tyreno Is Null[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|