sqlite char, ascii 函数 [英] sqlite char, ascii function
问题描述
sqlite 中是否有任何解决方法来弥补char()"和ascii()"函数的缺失?
Is there any work around in sqlite to cover for the lack of "char()" and "ascii()" function ?
例如:
char(97) => 'a'
ascii('a') => 97
推荐答案
我想,如果你真的想要,你可以创建一个带有 ASCIICHAR
列的ASCII 表"值表,并且ASCIICODE
列,并用 ASCII 表填充它.然后可以在查询/子查询中执行查找:
I suppose, if you really wanted to, you could create a "ASCII Table" Table of values with a ASCIICHAR
column, and a ASCIICODE
column, and populate it with the ASCII table. Then your lookups could be performed in queries / subqueries:
SELECT ASCIICHAR FROM ASCIITABLE WHERE ASCIICODE = 97;
实际上,Richard J. Ross III 的评论是关于金钱的 - 如果您使用 SQLite,您可能正在通过调用代码访问它,计算不能在那里完成吗?
Really though, Richard J. Ross III's comment is on the money - if you are using SQLite, you are probably accessing it through your calling code, couldn't the computation be done there?
这篇关于sqlite char, ascii 函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!