Код: Выделить всё
select distinct dma,
replace(dma, ' ', '_') as market
from table_name
group by dma;
Код: Выделить всё
select replace(dma,' ','_') as updated_dma,
count(*)
from table_name
where dma = 'Chicago'
group by 1;
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-in-mysql
Мобильная версия