Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update table with the boundaries in another

Status
Not open for further replies.

focus72050

Programmer
May 6, 2005
3
US
I have two tables, Inventory and Items

The Inventory table has
Qty_Min and Qty_Max

The Item Table has
Vendor_ID

I want to
Update Inventory
Set Qty_Min = 1 , Qty_Max = 3
Where Vendor_ID (from Items Table) = 'rdc'
thanks in advance guys
 


You need a means to join vendors to items, therefore the items table must have a foreign key to vendors (like vendor number), then it is easy to construct your update:
Code:
Update Inventory I
   Set Qty_Min = 1 , Qty_Max = 3
 Where I.Vendor_Nbr IN (  
    Select V.Vendor_Nbr
      From Vendors V
     Where Vendor_ID = 'rdc');
[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
The syntax may vary for different database brands.

Is there a key that can be used to JOIN the Inventory and Item table?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top