dm
2007-12-28 11:33:08 UTC
I have a table called PARAMETERS with 4 columns:
SKU (Primary key)
Reorder
Max
Min
I want to update the values for Reorder, Max, and Min. The updated values will be based on the carton dimensions which are stored in the table "SKU_DIM" (columns include: SKU, Width, Length, Height)
The columns in table PARAMETERS should be updated by SKU, with the following logic (note that depth & width are pulled from SKU_DIM)
Reorder:
floor(90/least(width, depth))*floor(105/greatest(width, depth)*2/3)
Max:
floor(90/least(width, depth))*floor(105/greatest(width, depth))
Min:
floor(90/least(width, depth))*floor(105/greatest(width, depth)/3)
How could I write an UPDATE statement to change the PARAMTER table based on the above logic, which relies on information from the SKU_DIM table?