Вы можете использовать оконную функцию row_number
create table tbl(id int primary key auto_increment, lang varchar(2));
insert into tbl(lang) values
('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'),
('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU'), ('EN'),('ES'),('RU');
with data as (
select
id, lang,
row_number() over (partition by lang order by rand()) rn
from tbl
)
select id, lang from data
where rn < 11;
MySQL window function