79454578

Date: 2025-02-20 12:57:42
Score: 1
Natty:
Report link

RIGHT or SUBSTRING both can be used for this:

Select string, 
case 
when RIGHT(string,1) in ('A','B','F') then 'ok'
else 'no'
end as new_column
from table

OR

Select string, 
case 
when SUBSTRING(string, LENGTH(string), 1) in ('A','B','F') then 'ok'
else 'no'
end as new_column
from table
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Puja Sen