Created
November 29, 2022 19:23
-
-
Save erikdarlingdata/a74996099ff9bbef9c5171c2df78f9b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
@a bit = 0, | |
@b bit = 0, | |
@r varchar(5) = ''; | |
/*This was 100x faster*/ | |
IF @b = 0 AND @a = 0 | |
RETURN 'S'; | |
IF @b = 0 AND @a = 1 | |
RETURN 'A'; | |
IF @b = 1 AND @a = 0 | |
RETURN 'B'; | |
RETURN 'AB'; | |
/*Than doing this*/ | |
IF @b = 0 AND @a = 0 | |
SET @r = 'S'; | |
IF @b = 0 AND @a = 1 | |
SET @r = 'A'; | |
IF @b = 1 AND @a = 0 | |
SET @r = 'B'; | |
ELSE | |
SET @r = 'AB' | |
RETURN @r; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment