문제

What is an equivalent to RIGHT() (as in FB2.5) for older versions of firebird (Firebird 2.0) without using UDFs?

도움이 되었습니까?

해결책

Use SUBSTRING and CHARACTER_LENGTH functions. Both internally available as of version FB 2.0:

SELECT
  IIF(CHARACTER_LENGTH(str_field) <= <right_characters_count>,
    str_field,
    SUBSTRING(str_field FROM 
      (CHARACTER_LENGTH(str_field) - <right_characters_count> + 1)))
FROM
  some_table
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top