table
id email aa bb
101 ####@qq.com 1 2
102 wwwww@qq.com 2 3
103 werwerwer@163.com 3 3
104 sdfsdfs@sina.com 3 2
要实现
域名 sum(aa) sum(bb)
qq.com 3 5
sina.com 3 2
163.com 3 3
sql正则表达式查询用法?
答案:2 悬赏:0 手机版
解决时间 2021-12-20 23:35
- 提问者网友:战魂
- 2021-12-20 19:53
最佳答案
- 五星知识达人网友:狂恋
- 2021-12-20 20:31
select domain = substring(email, charindex('@',email), len(email))
, aa = sum(aa), bb = sum(bb)
from [table]
group by substring(email, charindex('@',email), len(email))
, aa = sum(aa), bb = sum(bb)
from [table]
group by substring(email, charindex('@',email), len(email))
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯