Join 2 or 3 tables?

You could LEFT JOIN on both and see which title is filled, but really the database design is wrong here. You should have used a supertype table with subtype tables as you were told before, then you wouldn’t have this problem.

The main problem you’re having is that a device can be linked to both a UPS as well as a PDU in your schema. While in the real world this is not possible.

Make the impossible inexpressible. Meaning, if its not possible in the real world, it should not be possible in your model.

Because what happens if through some bug a device is connected to both a UPS as well as a PDU in your database? Obviously one of those is wrong. But which one? How could you tell?