SELECT SUBSTRING(nomecampo,1,7) AS testo FROM tabella
GROUP BY testo