惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - 路人甲乙丙丁张三

wsl安装docker后访问办公网故障 idea springboot多环境指定application.properties VIM 零宽度(断言)匹配用法示例 Oracle Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (HikariPool-1) has been closed. 透镜大灯H4线组的作用,是否需要买线组 vim 查看命令模式关键字总览清单 塘下摩托车驾校流程记录 IDEA 运行 Junit 测试用例报 !!! JUnit version 3.8 or later expected 记一次NoClassDefFoundError解决过程 win10 iis ftp用指定的用户名和密码无法登录 oracle merge into clob 无法从套接字获取更多数据 postman使用全局cookie,模拟浏览器保存cookie 写字板打开txt文件显示乱码问题原因 centos7.6挂载windows共享文件 VMware能上外网却不能和宿主机互相ping通的解决办法 jeesite 经常出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderL解决思路 使用jeesite org.springframework.beans.NotReadablePropertyException: Invalid property 'tfxqCmsAccount.id' of bean class Ambiguous handler methods mapped for HTTP path The method getContextPath() is undefined for the type ServletContext
mysql 根据某个字段将多条记录的某个字段拼接成一个字段
路人甲乙丙丁张三 · 2016-07-16 · via 博客园 - 路人甲乙丙丁张三

未合并情况

SELECT
a.id,
b.name
AS "role"
FROM
sys_user a
INNER JOIN sys_user_role c ON a.id=c.user_id
INNER JOIN sys_role b ON b.id =c.role_id
WHERE
a.del_flag=0
AND
b.del_flag=0

结果

id                  role

1                   系统管理员
1                   测试角色
2                   系统管理员
2                    测试角色
9                   系统管理员
9                   测试角色
d11828f3dbf148829287aeb637cbf6ec 系统管理员
d11828f3dbf148829287aeb637cbf6ec 测试角色
fe55ff534d23453ab66fda0912f6018d 系统管理员
fe55ff534d23453ab66fda0912f6018d 测试角色

合并情况

SELECT id,GROUP_CONCAT(role) AS "rolelist" FROM
(SELECT
a.id,
b.name
AS "role"
FROM
sys_user a
INNER JOIN sys_user_role c ON a.id=c.user_id
INNER JOIN sys_role b ON b.id =c.role_id
WHERE
a.del_flag=0
AND
b.del_flag=0)d
GROUP BY id

结果

id                       rolelist

1                    测试角色,系统管理员
2                     测试角色,系统管理员
9                     测试角色,系统管理员
d11828f3dbf148829287aeb637cbf6ec 测试角色,系统管理员
fe55ff534d23453ab66fda0912f6018d 测试角色,系统管理员

或者

select a.id,group_concat(b.name) AS rolelist
from sys_user a
inner join sys_user_role c on a.id = c.user_id
inner join sys_role b on b.id = c.role_id

WHERE
a.del_flag=0
AND
b.del_flag=0
group by a.id

结果也一样