drop table if exists t1;
create table t1 (a varchar(10) not null);
insert into t1 values ("a"),("ab"),("abc");
select * from t1;
a
a
ab
abc
select a, left(a,1) as b from t1;
a	b
a	a
ab	a
abc	a
select a, left(a,1) as b from t1 group by a;
a	b
a	a
ab	a
abc	a
SELECT DISTINCT RIGHT(a,1) from t1;
RIGHT(a,1)
a
b
c
drop table t1;
