Help with multiple joins
I have two tables, equipment and users. In the equipment table I have two field, owner and technician which both link to the users table id.
I can get the owner's name using a single join, but not sure how to get the technician's name
I've tried to use aliases but have had no success.
SELECT *, name, email FROM equipment
LEFT JOIN users ON equipment.owner = users.id
Need to see the tables' detaisl
, owner.name AS owner_name
, owner.email AS owner_email
, technician.name AS technician_name
, technician.email AS technician_email
JOIN users AS owner
ON owner.id = equipment.owner
JOIN users AS technician
ON technician.id = equipment.technician