Comment by fader
1 year ago
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.