sql - MySQL: Use a single Column to show as multiple select column in single row -


consider these example tables

enter image description here

enter image description here

e_id in table1 primary key. , assign_to foreign keys referenced e_id.

i want show table this:

enter image description here

i not sure how can implement it. please share sql query returns desired table.

you join table1 twice:

select     t2.work_name,     t1f.e_name `from`,     t1a.e_name `assign_to` table2 t2 inner join table1 t1f     on t1f.e_id = t2.`from` inner join table1 t1a     on t1a.e_id =t2.assign_to 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -