Created
January 25, 2024 22:22
-
-
Save ImShizer/b2a1ba64edc4014e19620d64fe36541c to your computer and use it in GitHub Desktop.
HW_VARS.sql
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 float = 26.32 | |
DECLARE @b float = 24.1 | |
DECLARE @c float = 46.12 | |
PRINT (@a + @b + @c) / 3 | |
IF DATEPART(HOUR, GETDATE()) BETWEEN 4 AND 11 | |
BEGIN | |
PRINT 'С добрым утром!' | |
END | |
ELSE IF DATEPART(HOUR, GETDATE()) BETWEEN 12 AND 17 | |
BEGIN | |
PRINT 'Добрый день!' | |
END | |
ELSE IF DATEPART(HOUR, GETDATE()) BETWEEN 18 AND 22 | |
BEGIN | |
PRINT 'Добрый вечер!' | |
END | |
ELSE | |
BEGIN | |
PRINT 'Спокойной ночи!' | |
END | |
DECLARE @num int = 123006 | |
DECLARE @fp int = @num / 100000 + @num / 10000 % 10 + @num / 1000 % 10 | |
DECLARE @sp int = @num / 100 % 10 + @num / 10 % 10 + @num % 10 | |
IF @fp = @sp | |
BEGIN | |
PRINT 'LUCKY!' | |
END | |
ELSE | |
BEGIN | |
PRINT 'UNLUCKY!' | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment