Comment by BeefWellington
1 year ago
Edit: In my pre-coffee rush this morning I completely missed the grouping by role (which is not that much harder FWIW). This unfortunately invalidates my entire post as it was posted and I don't want to spread misinfo.
I don't think your alternatives actually solve the same problem. Your alternatives would give you the single most recently joined employee. The actual problem being solved is to find the most recently joined employee in each role.
You'd need to do some grouping in there to be able to get one employee per role instead of a single employee out of the whole data set.
Yeah you're correct, I caught that and edited my reply right as you responded.
Time willing I will provide an updated reply with fixed SQL.