官方参考文档:SQLite Query Language: Core Functions http://www.sqlite.org/lang_corefunc.html
测试SQL语句:
SELECT substr(‘2012-12-12 10:11:12 fff‘,0,20) AS substr_0_20, substr(‘2012-12-12 10:11:12 fff‘,0,19) AS substr_0_19, substr(‘2012-12-12 10:11:12 fff‘,1,19) AS substr_1_19, substr(‘2012-12-12 10:11:12 fff‘,19) AS substr_19
测试语句结果:substr_0_20 和 substr_1_19结果保持一致;substr_0_19不知道为啥会少一位?
substr_0_20 | substr_0_19 | substr_1_19 | substr_19 |
2012-12-12 10:11:12 | 2012-12-12 10:11:1 | 2012-12-12 10:11:12 | 2 fff |
经过同事的测试,在IOS上substr_0_20 无法取到正常的结果。
时间: 2024-10-11 05:34:19