sql - MySQL: Use a single Column to show as multiple select column in single row -
consider these example tables
e_id in table1 primary key. , assign_to foreign keys referenced e_id.
i want show table this:
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
Post a Comment