0

I have to get count of each value separated by ## without using Any table or stored procedure . i have to get count for each value repeated by special symbol as per the given schema. I have tried alot but i want to make this result set without helping any reference table or stored procedure or temporary table.

Schema  is like this :-

CREATE TABLE USER_TABLE (
      id INT,
      name VARCHAR(20));


INSERT INTO USER_TABLE VALUES
(1, 'A##B##C'),
(2, 'B##C'),
(3,'A'),
(4,'B##C');

Expected output is Like :-

   Name  COUNT
     A     2
     B     3
     C     3
Shrikant Gupta
  • 131
  • 1
  • 11

1 Answers1

0

Try these query, may help you:

      Select GROUP_CONCAT((name) SEPARATOR '#') as name, count(name) as count FROM your_table
PACMAN
  • 41
  • 13