7 ms·
Isn't this a fairly simple way of doing this? That said, it is a bit non-obvious if you haven't seen it before. select earliest_joiner.* from employees as
by housecarpenter 3y ago
Isn't this a fairly simple way of doing this? That said, it is a bit non-obvious if you haven't seen it before.
select earliest_joiner.* from employees as earliest
left join employees as earlier on
earlier.role = earliest.role
and earlier.join_date < earliest.join_date
where earlier.id is null
order by earliest.join_date