Skip to content

Instantly share code, notes, and snippets.

@eldewall
Last active December 12, 2015 09:58
Show Gist options
  • Save eldewall/4755243 to your computer and use it in GitHub Desktop.
Save eldewall/4755243 to your computer and use it in GitHub Desktop.
IF @TypeId = 0
BEGIN
SELECT SuggestionId, [Message], [Type]
FROM so_Suggestion main
INNER JOIN so_Suggestion_Model joined ON main.SuggestionId = joined.SuggestionId
WHERE main.[Type] = @TypeId
END
ELSE IF @TypeId = 1
BEGIN
SELECT SuggestionId, [Message], [Type]
FROM so_Suggestion main
INNER JOIN so_Suggestion_Version joined ON main.SuggestionId = joined.SuggestionId
WHERE main.[Type] = @TypeId
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment