Select 条包含 substr 的记录

Select records with substr

在我的 table 中,我有一个包含 101014、101015 等字符串的列生产。我想 select 所有以 15 结尾的记录。我问:

SELECT * FROM boxes where substr('production',5,2) = 15

SELECT * FROM boxes where substr('production',5) = 15

没有返回任何内容..

SELECT * FROM boxes where production like '%15'

或者如果您想要 substr,而不是:

SELECT * FROM boxes where substr('production',5) = 15

尝试:

SELECT * FROM boxes where substr(production,5) = '15'