EDIT:
Assuming you've got the following table:
id string number
1 stuff::a::312 5
2 stuff:::a::312 6
3 stuff::a::233 2
4 stuff:b::213 1
5 stuff::b::222 1
6 stuff::c 5
The following doesn't work of course:
SELECT string, COUNT(*)
FROM tbl
-- WHERE
GROUP BY string;
The wished result:
string numbers
a 13
b 2
c 5
Sorry, but please note that after c is no :: but before, just like the rest
LEFT(string,10)if the charactersstuff::?::in front is the standard format/length of values in your string column.RIGHT(string,3)is the vice versa :)