展开全部
您好,您这样:
CREATE TABLE info (
users varchar(100)
);
INSERT INTO info VALUES('userA@userB@userC');
INSERT INTO info VALUES('userB@userC@userD');
INSERT INTO info VALUES('userC@userD@userE');
COLUMN "用户" FORMAT A15
SELECT
to_char(strvalue) as "用户",
count(*) AS "用户数"
FROM
info,
table(fn_split( info.users, '@'))
GROUP BY
to_char(strvalue)
ORDER BY
1;
用户 用户数
--------------- ----------
userA 1
userB 2
userC 3
userD 2
userE 1
CREATE TABLE info (
users varchar(100)
);
INSERT INTO info VALUES('userA@userB@userC');
INSERT INTO info VALUES('userB@userC@userD');
INSERT INTO info VALUES('userC@userD@userE');
COLUMN "用户" FORMAT A15
SELECT
to_char(strvalue) as "用户",
count(*) AS "用户数"
FROM
info,
table(fn_split( info.users, '@'))
GROUP BY
to_char(strvalue)
ORDER BY
1;
用户 用户数
--------------- ----------
userA 1
userB 2
userC 3
userD 2
userE 1
追问
您好
这样不行啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询