Answer the question
In order to leave comments, you need to log in
How to write a sample?
While I'm making a selection like this
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
Answer the question
In order to leave comments, you need to log in
Well, at least like this:
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question