bit rusty on sql. In the select expression, if the "string" field ends with the letter A, B or F Print 0k else, type No
I know that I need to make some substring, but I can not understand.
thanks
Use RIGHT:
RIGHT
SELECT Result = CASE WHEN RIGHT(string, 1) IN ('A','B','F') THEN 'Ok' ELSE 'No' END
It could be a trick
select right('abc', 1)
He can work
DECLARE @STR VARCHAR(50) SET @STR='DFGDFGF' SELECT CASE WHEN (SELECT RIGHT(@STR, 1)) = 'A' THEN 'OK' WHEN (SELECT RIGHT(@STR, 1)) = 'B' THEN 'OK' WHEN (SELECT RIGHT(@STR, 1)) = 'F' THEN 'OK' ELSE 'NOT OK' END
Source: https://habr.com/ru/post/1527683/More articles:Celery not working with a bulb - pythonPrint problem with fixed bootstrap navigation - htmlhow to remove a specific line from a list in angularjs - javascriptUsing a specific version of packages in MonoDevelop - servicestackСоздание нового приложения в Twitter приводит к ошибке "Превышено превышение лимита" - twitterTwitter bootstrap navigator with drop-down list - cssGrep error without error message - bashWhy is CountdownTimer not working? - androidHow to transfer bearer token on client side - securityFinishing autocomplete: how to set focus on autocomplete after clicking on a command link - primefacesAll Articles