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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

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

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

结果也一样