I need to fetch Created_By
and Modified_By
user names from master user table. I'm using Created_By_Id
and Modified_By_Id
in the table to look up master user table and fetching the employee name from it.
Currently my SQL query is:
select
act.*, created.name as created_by, modify.name as modified_by
from
[DUMP_ACTIVITY] act
left join
[MASTER_USER] created on act.Created_By_Id = created.id
left join
[MASTER_USER] modify on act.ModifiedById = modify.id
Now, I must left join the master user table two times repeatedly to do this. Is this correct?
Is there a workaround for this?