I have an employee with multiple managers. The manager name field has (firstname,lastname) and the email field has([email protected]).There is no Mgr id. So, when I try to group this by employee id to get the max of Mgr name and email, some times I end up getting the wrong name/email id combination.
ex:
person Mgr_name Mgr_email
------- --------- ----------
111 brad,pitt [email protected]
111 mike,clark [email protected]
when I group it by person and get the max(mgr_name),mgr_email, I get
person max(Mgr_name) max(Mgr_email)
------- --------- ----------
111 mike,clark [email protected]
How do I get the correct email/name combination?
dateortimestampcolumn that can be used to identify the latest row? Is there a monotonically increasing key column that can be used?