SELECT id, worker_id, (SELECT name FROM people WHERE id=worker_id) AS worker_name, (SELECT login FROM people WHERE id=worker_id) AS worker_login FROM workers_ads
SELECT id, worker_id, p.name AS worker_name, p.login AS worker_login FROM workers_ads wa
join people p on p.id = wa.worker_id