MySQL中的字符串集合和左连接

时间:2016-04-24 01:04:57

标签: mysql substring left-join

所以我有一个名为ajar的表和一个名为ajar_id的列: 另一个名为branch_id和列id的表:

存储ajar_id权限,格式如下:

`
+-----------------------+
| ajar_id               |
+-----------------------+
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["1"]                 |
| ["4","6"]             |
| ["2","3","4","5","6"] |
| ["6"]                 |
| ["2","3","4","5"]     |
+-----------------------+
`

我希望将它们与ajar表连接起来,在这个表中,特权存储就像

`
+----+
| id |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
|  6 |
|  7 |
|  8 |
|  9 |
| 10 |
| 11 |
+----+
`

我尝试了一些子字符串索引方法,但它没有用。 如何从第一个表的列中获取我想要的格式,并将它们与第二个表的列连接起来?

0 个答案:

没有答案