小编koj*_*ron的帖子

Mysql加入并连接

我有两张桌子:

table_a:            table_b
+----+------+    +----+---------+------+
| id | name |    | id | relation| name | 
+----+------+    ++++++---------+------+
| 1  | bob  |    | 1  | friend  | chris|
| 2  | jim  |    | 1  | friend  | jon  |
| 3  | tom  |    | 1  | brother | matt |
+----+------+    | 2  | friend  | sam  |
                 | 2  | parent  | ron  |
                 +----+---------+------+
Run Code Online (Sandbox Code Playgroud)

我想输入一个查询输出类似的东西

+----+------+------------+---------+--------+
| id | name |friend      | brother | parent …
Run Code Online (Sandbox Code Playgroud)

mysql sql join concatenation

6
推荐指数
1
解决办法
213
查看次数

标签 统计

concatenation ×1

join ×1

mysql ×1

sql ×1