sqlite> select datetime('now');
2004-01-05 17:23:58 -- correct day and time of day
sqlite> select datetime('now', 'weekday 0');
2004-01-11 00:00:00 -- correct day, lost time of day
sqlite> select datetime('now', '1 month');
2004-02-05 00:00:00 -- correct day, lost time of day
sqlite> select datetime('now', '1 year');
2005-01-05 00:00:00 -- correct day, lost time of day呵呵,正在研究。
2004-01-05 17:23:58 -- correct day and time of day
sqlite> select datetime('now', 'weekday 0');
2004-01-11 00:00:00 -- correct day, lost time of day
sqlite> select datetime('now', '1 month');
2004-02-05 00:00:00 -- correct day, lost time of day
sqlite> select datetime('now', '1 year');
2005-01-05 00:00:00 -- correct day, lost time of day呵呵,正在研究。
解决方案 »
- 为什么不用addslashes 或者htmlspecialchars
- php 操作xml的问题?
- php5 的数据库连接查询
- Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
- 高手请帮我看看
- 我也来征集大数量文件上传方案
- 学习PHP以来一直对类和对象的概念和使用比较模糊,请大家进来谈谈心得和体会。进者有分
- 为什么我的文本框里的内容传不到PHP中执行
- 谁能给一段access转为mysql的sql代码吗
- PHP可以不按ID,按栏位的英文查询数据吗?
- 为什么调用imagecreate()时提示Call to undefined function: imagecreate()
- 关于正则表达式的一个难题(在线等)
coalesce(X,Y,...) Return a copy of the first non-NULL argument. If all arguments are NULL then NULL is returned. There must be at least 2 arguments.
glob(X,Y) This function is used to implement the "X GLOB Y" syntax of SQLite. The sqlite3_create_function() interface can be used to override this function and thereby change the operation of the GLOB operator.
ifnull(X,Y) Return a copy of the first non-NULL argument. If both arguments are NULL then NULL is returned. This behaves the same as coalesce() above.
last_insert_rowid() Return the ROWID of the last row insert from this connection to the database. This is the same value that would be returned from the sqlite_last_insert_rowid() API function.
length(X) Return the string length of X in characters. If SQLite is configured to support UTF-8, then the number of UTF-8 characters is returned, not the number of bytes.
like(X,Y) This function is used to implement the "X LIKE Y" syntax of SQL. The sqlite_create_function() interface can be used to override this function and thereby change the operation of the LIKE operator.
lower(X) Return a copy of string X will all characters converted to lower case. The C library tolower() routine is used for the conversion, which means that this function might not work correctly on UTF-8 characters.
max(X,Y,...) Return the argument with the maximum value. Arguments may be strings in addition to numbers. The maximum value is determined by the usual sort order. Note that max() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.
min(X,Y,...) Return the argument with the minimum value. Arguments may be strings in addition to numbers. The minimum value is determined by the usual sort order. Note that min() is a simple function when it has 2 or more arguments but converts to an aggregate function if given only a single argument.
nullif(X,Y) Return the first argument if the arguments are different, otherwise return NULL.
quote(X) This routine returns a string which is the value of its argument suitable for inclusion into another SQL statement. Strings are surrounded by single-quotes with escapes on interior quotes as needed. BLOBs are encoded as hexadecimal literals. The current implementation of VACUUM uses this function. The function is also useful when writing triggers to implement undo/redo functionality.
random(*) Return a random integer between -2147483648 and +2147483647.
round(X)
round(X,Y) Round off the number X to Y digits to the right of the decimal point. If the Y argument is omitted, 0 is assumed.
soundex(X) Compute the soundex encoding of the string X. The string "?000" is returned if the argument is NULL. This function is omitted from SQLite by default. It is only available the -DSQLITE_SOUNDEX=1 compiler option is used when SQLite is built.
sqlite_version(*) Return the version string for the SQLite library that is running. Example: "2.8.0"
substr(X,Y,Z) Return a substring of input string X that begins with the Y-th character and which is Z characters long. The left-most character of X is number 1. If Y is negative the the first character of the substring is found by counting from the right rather than the left. If SQLite is configured to support UTF-8, then characters indices refer to actual UTF-8 characters, not bytes.
typeof(X) Return the type of the expression X. The only return values are "null", "integer", "real", "text", and "blob". SQLite's type handling is explained in Datatypes in SQLite Version 3.
upper(X) Return a copy of input string X converted to all upper-case letters. The implementation of this function uses the C library routine toupper() which means it may not work correctly on UTF-8 strings. avg(X) Return the average value of all X within a group.
count(X)
count(*) The first form return a count of the number of times that X is not NULL in a group. The second form (with no argument) returns the total number of rows in the group.
sum(X) Return the numeric sum of all values in the group.
例如使用md5()
SELECT php('md5', filename) from files
SQLite没有show tables?show tables有时候用起来蛮方便的嘛...
当select * from sqlite_master时就可得到全部表信息