O. Jones
Thanks for the help, this fixed my issue. The end query I ended up using was
select count(*),name, value from TABLEĀ where name not like '%ts%' group by value,nameĀ order by name;
And this did exactly what I needed.