【发布时间】:2021-03-27 19:25:07
【问题描述】:
获取 |A|test1,test3| 的 SQL 查询从这两个表A1,A2 A1
| permission | user |
| ---------- | -----|
| 7,9 | A |
| 10,7 | B |
A2
| permission | fullname |
| ---------- | ---------|
| 7 | test1 |
| 10 | test2 |
| 9 | test3 |
我需要一个能够为我提供用户、全名的查询 例子
|A|test1,test3|
|B|test2,test1|
用对应的字符串替换数字
【问题讨论】:
-
修复你的数据模型!不要在单个列中存储多个值!不要将数字存储在字符串中!正确声明外键约束!
标签: mysql sql mysql-python