使用 SQL 搜索以“9”结尾的整数

Search for an integer ending in '9' using SQL

作为查询的一部分,我需要搜索最后一个数字为 9 的九位数字。

我将如何进行这样的查询?

select colname from tablename where colname%10 = 9

试试这个

len 函数确保您要查找的内容的长度为 9 个字符

Select * from table where column like '%9' and len(column) = 9

Where 子句:

Where n % 10 = 9

MOD informix 中的 %
和 9 位数字之间

select colname 
from tablename 
where 
    MOD(colname, 10) = 9
and colname between 100000000 and 999999999