I have a table that contains the following
OEMSubNumber2, 3 and 4 are all empty. I need to fill those columns with results from the query i need.
I used the following sql query to find all records where OEMPartNumber and OEMSubNumber Matched
SELECT OEMPartNumber FROM JD WHERE OEMPartNumber = OEMSubNumber
UNION SELECT OEMSubNumber FROM JD;
Here is an example
OEMPartNumber - OEMDescription - OEMSubNumber
AR57112 - USE PN AR82761 - AR82761
AR82761 - USE PN AR88536 - AR88536
AR88536 - Lever
What i need to get that to is
OEMPartNumber - OEMDescription - OEMSubNumber - OEMSubNumber2
AR88536 - Lever - AR82761 - AR57112
The reason for this is because i need to get rid of those duplicate rows that just reference the latest part number.
So any duplicate from that query above needs to be placed in the OEMSubNumber2, 3 or 4 depending on how many.
Make Sense? Is this possibe?