I have 2 tables: INV and PC_EQUIP. INV has 2 pertinent fields, CPU and PRT that contains data the resides in a single field in PC_EQUIP call Serial. I have a query that works as I am using the CPU and PRT fields in INV to match up with the Serial field in PC_EQUIP to return data from the Model field in PC_EQUIP. Code below:
SELECT INV.FULLNAME,INV.OFFICE, INV.location,....... INV.CPU, INV.PRT, PC_EQUIP.Model
FROM INV Left JOIN PC_EQUIP ON (INV.CPU = PC_EQUIP.Serial) OR (INV.PRT = PC_EQUIP.Serial)
WHERE INV.FULLNAME <> 'None'
ORDER BY INV.location ASC, INV.FULLNAME ASC
The code returns all the fields and the PC_EQUIP.Model for CPU in one line and PC_EQUIP.Model for the match to PRT in a second line. Of course the second line will duplicate all the fields that are not part of the JOIN. Is there any way to get the two fields returned to a single line using "AS" or something to distinguish the 2 instances of Model the Join is producing?
Grasping at straws here.
DISCLAIMER: I'm not a DBA or web programmer so my SQL programming is negligible.