Jump to content

How can I update fields in a table where the select is from 2 tables?


Guest Kol1906

Recommended Posts

Guest Kol1906

I need to update a field of quntity for several items in a table called BillOfMatterials only for items that have Width >1500 in a table called ItemMasterThe ItemNo. is the connection between the tables.Please help.

Link to comment
Share on other sites

Guest Kane Sheng
I need to update a field of quntity for several items in a table called BillOfMatterials only for items that have Width >1500 in a table called ItemMasterThe ItemNo. is the connection between the tables.Please help.
UPDATE BillOfMatterials SET quntity = a numberWHERE items IN( SELECT Width FROM ItemMasterWHERE Width > 1500);Maybe wrong I'm not sure~ :-) hope BillOfMatterials table knows Width field.*Or you can create a new table first* SELECT quntity, With INTO new_tableFROM BillOfMatterials INNER JOIN ItemMasterON BillOfMatterials_ItemNo = ItemMaster.ItemNo*Then Update it in the new_table*UPDATE new_table SET quntity = new_numberWHERE With > 1500
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...