I want to update records in a table. These records I want to update should be in order (first by pkey asc). Next the qty I want to update will be stored in another field.
update
table
pkey description status tray
---- ----------- ------ ----
1 widget 0 0
2 widget 1 0
3 widget 1 0
4 widget 1 0
5 widget 2 0
6 widget 2 0
widget
table
desc QtyPerCase
------ ----------
widget 2
For this example I want to update the first (qtypercase
) to tray XX order by pkey
asc.
There will be different widgets and qtypercase
so I need it to be dynamic.
Expected result:
pkey description status tray
---- ----------- ------ ----
1 widget 0 0
2 widget 1 99
3 widget 1 99
4 widget 1 0
5 widget 2 0
6 widget 2 0
I hope I asked this well. Thanks guys in advance for the help.