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)
 JOINS

Author  Topic 

vis_karthik@hotmail.com
Starting Member

2 Posts

Posted - 2006-06-19 : 12:28:56
Have three tables
ItemMaster (ItemPartNumber, DUNSVendorNUmber)
Branches (Branch Number)
CatalogViews (ItemPartNumber,DUNSVendorNUmber, Branch Number)

The objective is to get those itempartnumbers from itemmaster for a particular DUNSVendorNumber that are not there in every branch in catalog views

Would appreciate if any of you could help with this

cmdr_skywalker
Posting Yak Master

159 Posts

Posted - 2006-06-19 : 12:44:56
quote:
...that are not there in every branch in catalog views

I am not sure of what you mean? Do you mean that every item should be in each Branch based on ItemMaster/Branches table and thus, if the CatalogViews does not have this combination, it will be reported? Or based on the CatalogViews, you come up with the list of ItempartNumber, Branch Number and if its not found with DUNSVendorNumber, it will be reported.



May the Almighty God bless us all!
Go to Top of Page

vis_karthik@hotmail.com
Starting Member

2 Posts

Posted - 2006-06-19 : 12:56:45
Every Branch Must have every itempartnumber from itemmaster in the catalog views table.

eg.
Branches
--------
05066
05067

ItemMaster DUNSVendorNumber
---------- ----------------
11192 002164457
1119200 002164457
11335 002164457
1133500 002164457
11336 002164457
1133600 002164457
4161 002164457
4354 002164457
4355 002164457

CatalogViews
------------
ItemPartNumber DUNSVendorNumber Branch
-------------- ---------------- ------
4355 002164457 05067
4355 002164457 05066
4354 002164457 05067

In In the above example item 4354 exist only for 05067. When we disply data it must display all itempartnumbers from itemmaster that do not have an entry for every branch. So since item 4354 is not there in CatalogViews for 05066 that should also be displayed.


Go to Top of Page
   

- Advertisement -