sql - Combining values in group by -


i have group question.

values in table can follows:

name1 name2 name1;name1 name1 name2;name2;name2 

i need counts field combining values. sorry, it's little hard explain, need combine 1 total whether value 'name1' or 'name1;name1' or 'name1;name1;name1' (can repeated number of times). result be

name1  - 3  name2  - 2 

thank you.

if values ones in example, try this:

select     left(t.col, 5), count(*) <your table> t group left(t.col, 5) 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -