0

I am having a database having name and hobbies(as multivalued attribute) and I want to find out what is the count of occurence of more than one same value For example If this is a sample database

A reading
A dancing
B reading
B dancing

Then the result should be

List of hobbies  | Number of occurrence
-----------------|---------------------
reading, dancing | 2 
gmile
  • 13,933
  • 13
  • 62
  • 96

1 Answers1

0

I think you have a query like this:

SELECT hobbies, Count(*) As hNo 
FROM t
GROUP BY hobbies

That have a result set like this:

hobbies | hNo
--------+------
reading | 2 
dancing | 2

Now for this data-set you can follow answers of this question [Concatenate many rows into a single text string] to have them in one row.

Community
  • 1
  • 1
shA.t
  • 15,880
  • 5
  • 49
  • 104