PostgreSQL group by greater than equal to

select r2.val, (select count(*) from r1 where r1.b>=r2.val) as count_gte from r2