I have the following structure:
TABLE1 TABLE2
id_worker_main id_worker
id_worker_sub name_worker
I need to make a select getting the name_worker for both id_worker_main and id_worker_sub, but I can't. The following query return the same name twice.
SELECT t2.name_worker as main, t2.name_worker as sub
FROM table1
INNER JOIN table2 ON t1.id_worker_main = t2.id_worker AND t1.id_worker_sub = t2.id_worker