#1235 - This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
You could use the window function row_number, like so:

select id, collection, name from (
  select id, collection, name, 
  row_number() over (partition by collection order by id) rn
  from stac_item 
) t
where rn &lt; 3
order by id