I have a table in t-sql which looks like this
personid | firstname | lastname | managerid
1 | Tom | Bricks | null
2 | Joe | Liam | 1
3 | Mary | Hattan | 2
I am trying to query out a table like this:
Name | ManagerName
Tom | No manager
Joe | Tom
Mary | Joe
I can't seem to figure out way how to query the second column out my query as it stands is like this :
SELECT 'firstname' + ' ' + 'lastname' AS 'Name
Anyone got any idea?