user
id | user_name
7 | ab
8 | hb
9 | OR
orders
order_id | user_id | assign_date|description | other
1 | 8 | 2015-10-03 |test desc. | NULL
2 | 9 | 2015-10-03 |test abc. | NULL
3 | 9 | 2015-10-03 |test d. | NULL
4 | 7 | 2015-10-03 |test desc. | NULL
5 | 8 | 2015-10-03 |test abc. | NULL
6 | 8 | 2015-10-03 |test desc. | NULL
7 | 7 | 2015-10-03 |test desc. | NULL
8 | 9 | 2015-10-03 |test da. | NULL
9 | 8 | 2015-10-03 |test desc. | NULL
我正在寻找这样的输出(标题为用户ID和相关user_id列中的订单号列表)
user_id7 | user_id8 | user_id9 |
4 | 1 | 2 |
7 | 5 | 3 |
| 6 | 8 |
| 9 |