create table t (a integer, b text);
insert into t values (1, 'a'), (2, 'a'), (3, 'a'), (10, 'b'), (11, 'b'), (0, 'c');
I need to limit select by 2 first groups of column b (1 - a, 2 - b);
select * from t order by b;
 a  | b 
----+---
  1 | a
  2 | a
  3 | a
 10 | b
 11 | b
 -- limit here
  0 | c
(6 rows)
Something like where b in (select distinct(b) from t order by b limit 2) whithout subquery.
 
    