Can I select the same column twice? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can I select the same column twice?

I want to select the names of employees vs the names of their supervisors. Where each employee hava a field for his supervisor's id and the supervisors themselves are also employees in the employees table. How can i do that?

9th Jan 2017, 3:14 PM
Ahmed Elzoughby
Ahmed Elzoughby - avatar
1 Answer
0
try this, change the column/tables name to match your column/tables SELECT employees.name, supervisors.name FROM employees INNER JOIN employees ON employees.superId = supervisors.id
9th Jan 2017, 3:37 PM
Uran Kajtazaj
Uran Kajtazaj - avatar