Table structure as below:
EmpID ItemsPurchased EmailID
C12 Bread firstname.lastname@example.org
C15 Watch email@example.com
I would need email ids to populated partitioned by empid. ie., firstname.lastname@example.org should be populated for all rows of C12 and similiarly, email@example.com for C14 empid.
You could use the MAX window function :
select EmpID , ItemsPurchased , EmailID , max(EmailID) over(partition by EmpId) as EmailID_populated from MyTable;