转载:http://www.feiesoft.com/00012/

abs(X)

abs(X)返回 X 的绝对值。

Abs(X) returns NULL if X is NULL.

Abs(X) return 0.0  if X is a string or blob that cannot be converted to a numeric value. If X is  the integer -9223372036854775807 then abs(X) throws an integer overflow error  since there is no equivalent positive 64-bit two complement value.

changes()

changes()函数返回数据库已更新的记录数INSERT, DELETE, UPDATE 语句。

char(X1,X2,...,XN) 返回X1,X2,...,XN等UNICODE码对应的字符。
coalesce(X,Y,...)

返回第一个非空参数,全为NULL时返回NULL;参数至少包含两个参数。

glob(X,Y) 用于实现SQLite的 "X GLOB Y"语法。可使用 sqlite3_create_function() 重载该函数从而改变GLOB运算符的功能。
ifnull(X,Y) 返回第一个非空参数的副本。 若两个参数均为NULL,返回NULL。与coalesce()类似。
instr(X,Y) The instr(X,Y) function finds the first occurrence  of string Y within string X and returns the number of prior characters plus  1, or 0 if Y is nowhere found within X. Or, if X and Y are both BLOBs, then  instr(X,Y) returns one more than the number bytes prior to the first  occurrence of Y, or 0 if Y does not occur anywhere within X. If both  arguments X and Y to instr(X,Y) are non-NULL and are not BLOBs then both are  interpreted as strings. If either X or Y are NULL in instr(X,Y) then the  result is NULL.
hex(X) The hex() function interprets its argument as a BLOB  and returns a string which is the upper-case hexadecimal rendering of the  content of that blob.
last_insert_rowid() The last_insert_rowid() function returns the ROWID  of the last row insert from the database connection which invoked the  function. The last_insert_rowid() SQL function is a wrapper around thesqlite3_last_insert_rowid()  C/C++ interface function.
length(X) For a string value X, the length(X) function returns  the number of characters (not bytes) in X prior to the first NUL character. Since  SQLite strings do not normally contain NUL characters, the length(X) function  will usually return the total number of characters in the string X. For a  blob value X, length(X) returns the number of bytes in the blob. If X is NULL  then length(X) is NULL. If X is numeric then length(X) returns the length of  a string representation of X.
like(X,Y)
 like(X,Y,Z)

用于实现SQL语法"X LIKE Y [ESCAPE Z]".若使用可选的ESCAPE子句,则函数被赋予三个参数,否则只有两个。可使用sqlite3_create_function() 重载该函数从而改变LIKE运算符的功能。 注意同时重载like()的两参数和三参数版本,否则在使用/不使用 ESCAPE子句时,LIKE运算符的实现可能使用的是不同的代码。

likelihood(X,Y) The likelihood(X,Y) function returns argument X  unchanged. The value Y in likelihood(X,Y) must be a floating point constant  between 0.0 and 1.0, inclusive. The likelihood(X) function is a no-op that  the code generator optimizes away so that it consumes no CPU cycles during  run-time (that is, during calls to sqlite3_step()). The purpose of the  likelihood(X,Y) function is to provide a hint to the query planner that the  argument X is a boolean that is true with a probability of approximately Y.  The unlikely(X) function is short-hand for likelihood(X,0.0625).
load_extension(X)
 load_extension(X,Y)
尝试加载一个SQLite扩展库
lower(X) 转换为小写
ltrim(X)
 ltrim(X,Y)
The ltrim(X,Y) function returns a string formed by  removing any and all characters that appear in Y from the left side of X. If  the Y argument is omitted, ltrim(X) removes spaces from the left side of X.
max(X,Y,...) 返回一组中的最大值。
min(X,Y,...) 返回一组中的最小值。
nullif(X,Y) 当两参数不同时返回X,否则返回NULL。
quote(X) 返回参数的适于插入其它SQL语句中的值。字符串会被添加单引号,在内部的引号前会加入逃逸符号。BLOB被编码为十六进制文本。当前的VACUUM使用这一函数实现。在使用触发器实现撤销/重做功能时这一函数也很有用。
random() 返回一个[-9223372036854775808,+9223372036854775807]区间内的随机数
randomblob(N) The randomblob(N) function return an N-byte blob  containing pseudo-random bytes. If N is less than 1 then a 1-byte random blob  is returned. Hint: applications can generate globally unique  identifiers using this function together with hex() and/or lower() like this:hex(randomblob(16))
 
 lower(hex(randomblob(16)))
replace(X,Y,Z) The replace(X,Y,Z) function returns a string formed  by substituting string Z for every occurrence of string Y in string X. The BINARY  collating sequence is used for comparisons. If Y is an empty string then  return X unchanged. If Z is not initially a string, it is cast to a UTF-8  string prior to processing.
round(X)
 round(X,Y)
将X四舍五入,保留小数点后Y位。若忽略Y参数,则默认其为0。
rtrim(X)
 rtrim(X,Y)

rtrim(X,Y) 返回去除X串右边的Y字符的副本。

rtrim(X) 返回去除X串右边的空格字符的副本。

soundex(X) The soundex(X) function returns a string that is the  soundex encoding of the string X. The string "?000" is returned if  the argument is NULL or contains no ASCII alphabetic characters. This  function is omitted from SQLite by default. It is only available if the SQLITE_SOUNDEX  compile-time option is used when SQLite is built.
sqlite_compileoption_get(N) The sqlite_compileoption_get() SQL function is a  wrapper around the sqlite3_compileoption_get()C/C++ function. This  routine returns the N-th compile-time option used to build SQLite or NULL if  N is out of range. See also the compile_options pragma.
sqlite_compileoption_used(X) The sqlite_compileoption_used() SQL function is a  wrapper around the sqlite3_compileoption_used()C/C++ function. When  the argument X to sqlite_compileoption_used(X) is a string which is the name  of a compile-time option, this routine returns true (1) or false (0)  depending on whether or not that option was used during the build.
sqlite_source_id() The sqlite_source_id() function returns a string  that identifies the specific version of the source code that was used to  build the SQLite library. The string returned by sqlite_source_id() begins  with the date and time that the source code was checked in and is follows by  an SHA1 hash that uniquely identifies the source tree. This function is an  SQL wrapper around the sqlite3_sourceid() C interface.
sqlite_version() 返回SQLite数据库版本信息
substr(X,Y,Z)
 substr(X,Y)
返回输入字符串X中以第Y个字符开始,Z个字符长的子串。 X最左端的字符序号为1。若Y为负,则从右至左数起。若SQLite配置支持UTF-8,则“字符”代表的是UTF-8字符而非字节。
total_changes() The total_changes() function returns the number of  row changes caused by INSERT, UPDATE or DELETE statements since the current  database connection was opened. This function is a wrapper around thesqlite3_total_changes()  C/C++ interface.
trim(X)
 trim(X,Y)
The trim(X,Y) function returns a string formed by  removing any and all characters that appear in Y from both ends of X. If the  Y argument is omitted, trim(X) removes spaces from both ends of X.
typeof(X) 返回表达式X的类型。返回值可能为"null", "integer", "real", "text", 以及 "blob".
unlikely(X) The unlikely(X) function returns the argument X  unchanged. The unlikely(X) function is a no-op that the code generator optimizes  away so that it consumes no CPU cycles at run-time (that is, during calls to sqlite3_step()).  The purpose of the unlikely(X) function is to provide a hint to the query  planner that the argument X is a boolean value that is usually not true. The  unlikely(X) function is equivalent tolikelihood(X, 0.0625).
unicode(X) The unicode(X) function returns the numeric unicode  code point corresponding to the first character of the string X. If the  argument to unicode(X) is not a string then the result is undefined.
upper(X) 转换为大写
zeroblob(N) The zeroblob(N) function returns a BLOB consisting  of N bytes of 0x00. SQLite manages these zeroblobs very efficiently.  Zeroblobs can be used to reserve space for a BLOB that is later written using  incremental  BLOB I/O. This SQL function is implemented using the sqlite3_result_zeroblob()  routine from the C/C++ interface.

SQLite的37个核心函数的更多相关文章

  1. SQLite学习手册(内置函数)

    一.聚合函数: SQLite中支持的聚合函数在很多其他的关系型数据库中也同样支持,因此我们这里将只是给出每个聚集函数的简要说明,而不在给出更多的示例了.这里还需要进一步说明的是,对于所有聚合函数而言, ...

  2. 解密jQuery内核 DOM操作的核心函数domManip

    domManip是什么 dom即Dom元素,Manip是Manipulate的缩写,连在一起就是Dom操作的意思. .domManip()是jQuery DOM操作的核心函数 对封装的节点操作做了参数 ...

  3. PHP基于数组的分页函数(核心函数array_slice())

    关于数组的分页函数,用数组进行分页的好处是可以方便的进行联合多表查询,只需要将查询的结果放在数组中就可以了以下是数组分页的函数,函数page_array用于数组的分页,函数show_array用于分页 ...

  4. Jquery核心函数

    在Jquery中,所有的DOM对象都将封装成Jquery对象,而且只有Jquery对象才能使用Jquery方法或者属性来执行相应的操作. 所以Jquery提供了一个可以将DOM对象封装成Jquery对 ...

  5. Ajax 核心函数

    今天刚刚了解了Ajax的一个核心函数,由于对javascript还没有系统的学习,目前还没有深入研究Ajax.但是在运用此函数的同时也发现了一些问题--编码问题.这样在后台接收到的URL参数若果有汉字 ...

  6. 【OpenGL游戏开发之三】OpenGl核心函数库汇总

    OpenGl核心函数库 glAccum 操作累加缓冲区 glAddSwapHintRectWIN 定义一组被SwapBuffers拷贝的三角形 glAlphaFunc允许设置alpha检测功能 glA ...

  7. Jquery()核心函数的7个重载方法

    (1) jquery() 该函数返回一个空的jQuery对象.在jQuery1.4以后的版本中,改函数返回一个空的jQuery对象.在之后的版本中,该函数会返回一个包含document节点的对象. ( ...

  8. zepto学习之路--核心函数$()的实现

    $()可以说是jquery的精华了,为dom操作带来了极大的灵活和方便.zepto号称“移动版的jquery”,那么它是怎么来实现这个核心函数呢?我们来详细探讨下. 1.首先,我们看下zepto中它是 ...

  9. JQuery --- 第一期 (初识jQuery, JQuery核心函数和工具方法)

    个人学习笔记  初识jQuery 1.我的第一个JQuery <!DOCTYPE html> <html lang="en"> <head> & ...

随机推荐

  1. 函数fil_extend_space_to_desired_size

    /**********************************************************************//** Tries to extend a data f ...

  2. CodeForces 489C (贪心) Given Length and Sum of Digits...

    题意: 找出m位且各个数位数字之和为s的最大和最小整数,不包括前导0(比如说003是非法的),但0是可以的. 分析: 这题是用贪心来做的,同样是m位数,前面的数字越大这个数就越大. 所以写一个can( ...

  3. HDU 1425 sort 【哈希入门】

    题意:给出n个数,输出前m大的数 和上一题一样,将输入的数加上一个极大地值作为地址 #include<iostream> #include<cstdio> #include&l ...

  4. SelectSingleNode和SelectNodes区别

    SelectSingleNode:选择匹配 XPath 表达式的第一个 XmlNodeSelectNodes:选择匹配 XPath 表达式的结点集合 XmlNodeList

  5. 解决IE6下png图片不透明

    ie6着实是非常让人讨厌,显示一张图片,也要带着灰白色的背景色,一张好好的png图片就这么不透明了. 用n多中网上的方式,差点成功的就还有这个了 _background: none; _filter: ...

  6. 微信开发之Ngrok环境准备(一)

    一.为什么要使用ngrok? 各位肯定都知道,做微信开发,我们的开发服务器需要和微信服务器做交互,SO,我们需要准备一台放置在公网的服务器,能够使得我们的服务器可以正常访问微信服务器,并且微信服务器也 ...

  7. java AES加密算法

    package com.siro.tools; import javax.crypto.Cipher;import javax.crypto.spec.IvParameterSpec;import j ...

  8. 两个数组a[N],b[N],其中A[N]的各个元素值已知,现给b[i]赋值,b[i] = a[0]*a[1]*a[2]…*a[N-1]/a[i];

    转自:http://blog.csdn.net/shandianling/article/details/8785269 问题描述:两个数组a[N],b[N],其中A[N]的各个元素值已知,现给b[i ...

  9. codeforces 675C Money Transfers map

    上面是官方题解,写的很好,然后就A了,就是找到前缀和相等的最多区间,这样就可以减去更多的1 然后肯定很多人肯定很奇怪为什么从1开始数,其实从2开始也一样,因为是个环,从哪里开始记录前缀和都一样 我们的 ...

  10. DIV+CSS常见问题:DIV如何设置一个像素高度?

    CSS如何控制DIV实现1像素高度呢?问题看起来很简单,但万恶的IE6会让你很麻烦,不过解决办法很多,本文将介绍最简单的一种:DIV{height:1px;line-height:1px;font-s ...