SQL Server Query Help

Hi guys,

I am having a brain fart and would appreciate some quick help.

If I have table ‘users’:
id username
1 samb
2 heathert

and table 'projects:
id name created_by_user_id assigned_to_user_id
1 proj1 2 1
2 proj1 1 2

What is the SQL Server query to return:
name created_by assigned_to
proj1 heathert samb
proj2 samb heathert

I would like to help but i don’t understand how you have described your tables.

This might help…

Select p.name, u1.username as created_by, u2.username as assigned_to
From projects p Left Join users u1 On p.created_by_user_id = u1.id
    Left Join users u2 On p.assigned_to_user_id = u2.id

Thanks Phil!