I am working for a motorhome company and they want to make a online parts catlogue available. Each vehicle built has a unique id code(build number), what i am doing is when someone inputs a build number, there entire worksorder (ie the list of parts that go into that vehicle) is produced...this is fine....however if there are more than two of exactly the same part in the worksorder, it appears twice in the list....instead i want count how many times that part is used in that vehicle.
The sql script (sorry about the formatting)
SELECT PART.ID, PART.DESCRIPTION FROM PART, REQUIREMENT, OPERATION WHERE PART.ID = REQUIREMENT.PART_ID AND OPERATION.WORKORDER_BASE_ID = REQUIREMENT.WORKORDER_BASE_ID AND OPERATION.WORKORDER_LOT_ID = REQUIREMENT.WORKORDER_LOT_ID AND OPERATION.WORKORDER_SPLIT_ID = REQUIREMENT.WORKORDER_SPLIT_ID AND OPERATION.WORKORDER_SUB_ID = REQUIREMENT.WORKORDER_SUB_ID AND OPERATION.WORKORDER_TYPE = REQUIREMENT.WORKORDER_TYPE AND PART.ID Like '[0-9][0-9][a-z][a-z][a-z][0-9][0-9][0-9][0-9]' and PART.ID NOT Like '[0-9][0-9]SHT[0-9][0-9][0-9][0-9]' AND PART.ID NOT Like '[0-9][0-9]TIM[0-9][0-9][0-9][0-9]' AND OPERATION.WORKORDER_BASE_ID Like '".$_SESSION['buildnumber']."%' ORDER BY PART.DESCRIPTION asc;
What i would like is a third result field with the number of occurences of the same part (work with PART.ID)
Any ideas
Thanks in advance
please email any further question you may have or dont understand what i have written