I have been working on a query:
SELECT P.[Name]+' - '+P.[Description] AS Sprint, S.[Number] AS Story, T.[Name] AS Task
FROM DailyTaskHours D
INNER JOIN Task T ON D.TaskId = T.PK_Task
INNER JOIN Story S ON T.StoryId = S.PK_Story
INNER JOIN Sprint P ON S.SprintId = P.PK_Sprint
GROUP BY P.[Name], P.[Description], S.[Number], T.[Name]
The Sprint column may or may not be NULL:
The above query will only return the requested columns if there is a SprintId associated. If it is NULL the whole column will not be returned. This makes sense, S.SprintId = P.PK_Sprint is not equivelant when it is NULL on the Story table.
If it's NULL I still want it to return the row with all of the other tables columns data but with the word KanBan instead of not returning anything. How do I achieve this?