Hai,
I need to display count of each text occurrence on all rows from a particular column.
See result below:

Here I have a set of Tags, I need to display count each tag as column in the name 'Total'
What I have done is:
- DECLARE @tags VARCHAR(8000)
- DECLARE @tot INT
- select @tags = coalesce(@tags + ',' , ' ') + Labels from addNew
- select @tot = count(@tags)
- select a.Labels as Tags,@tot as Total from addNew a
- inner join addNew n
- on a.Labels = n.Labels
- group by a.Labels
the result must be:
Please suggest your queries to get my desired result.
Thank in Advance.

Tapan PatelRank #614 · 3.9K reputationPosted Oct 5, 2017, 4:35 PM EDT
Guruprakash C126 reputationPosted Oct 8, 2017, 6:57 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts