Hey Guys,
Looking for some help I have a Table called 'cp_t' with the following columns
I need to add in a new column that will sum the values in Qty if it matches the value in the current row from P_ID and Material without using a group by.
the new table would look like this
NOTE: the above is a basic eg. the main table has around 6million rows and over 100 unique P_ID's. When queried there are usually 50k-200k rows not the full table in the results.
I have tried to do it using a Cross Join but I am fairly new to SQL I am struggling to get the sum to work with case arguments passing in a variable argument that would work on each row.
Really appreciate any and all help