[转]SQLite 经验集
SQLite 的默认时间 转自:http://www.cnblogs.com/pennant/archive/2011/08/11/2134897.html
select strftime('%Y-%m-%d %H:%M:%S','now')
这个查询的结果是 UTC时间,即 +8h 才和电脑时间相同。
select time('now')
这个查询的结果是 01:02:03 ,也要 +8h 才和电脑时间相同。
select date('now')
这个查询的结果是 2017-03-02
select datetime('now')
这个查询的结果是 2017-03-02 01:02:03
%d 一月中的第几天01-31 %f 小数形式的秒,SS.SSSS %H 小时00-24 %j 一年中的第几天01-366 %J Julian Day Numbers %m 月份01-12 %M 分钟00-59 %s 从1970-01-01日开始计算的秒数 %S 秒00-59 %w 星期,0-6,0是星期天 %W 一年中的第几周00-53 %Y 年份0000-9999 %% %百分号
SQLite: Data Types - 数据类型
The following is a list of datatypes available in SQLite, which includes string, numeric, date/time, and large object datatypes.
For simplicity's sake, SQLite essentially uses these basic datatypes:
- TEXT
- INTEGER
- NUMERIC
- REAL
- NONE
To be compatible with other SQL databases, SQLite allows you to use the common datatype names that you've seen in other databases and maps them to their basic SQLite datatypes (listed above).
Let's look at the common datatypes names that SQLite lets you define.
String Datatypes
All string datatypes in SQLite are converted to a TEXT datatype. If you try to specify a size for a string datatype, SQLite will ignore it, as it does not allow size restrictions on string datatypes.
The following are the String Datatypes in SQLite:
| Data Type Syntax | Explanation |
|---|---|
| CHAR(size) | Equivalent to TEXT (size is ignored) |
| VARCHAR(size) | Equivalent to TEXT (size is ignored) |
| TINYTEXT(size) | Equivalent to TEXT (size is ignored) |
| TEXT(size) | Equivalent to TEXT (size is ignored) |
| MEDIUMTEXT(size) | Equivalent to TEXT (size is ignored) |
| LONGTEXT(size) | Equivalent to TEXT (size is ignored) |
| NCHAR(size) | Equivalent to TEXT (size is ignored) |
| NVARCHAR(size) | Equivalent to TEXT (size is ignored) |
| CLOB(size) | Equivalent to TEXT (size is ignored) |
Numeric Datatypes
All numeric datatypes in SQLite are converted to INTEGER, NUMERIC, or REAL datatypes.
The following are the Numeric Datatypes in SQLite:
| Data Type Syntax | Explanation |
|---|---|
| TINYINT | Equivalent to INTEGER |
| SMALLINT | Equivalent to INTEGER |
| MEDIUMINT | Equivalent to INTEGER |
| INT | Equivalent to INTEGER |
| INTEGER | Equivalent to INTEGER |
| BIGINT | Equivalent to INTEGER |
| INT2 | Equivalent to INTEGER |
| INT4 | Equivalent to INTEGER |
| INT8 | Equivalent to INTEGER |
| NUMERIC | Equivalent to NUMERIC |
| DECIMAL | Equivalent to NUMERIC |
| REAL | Equivalent to REAL |
| DOUBLE | Equivalent to REAL |
| DOUBLE PRECISION | Equivalent to REAL |
| FLOAT | Equivalent to REAL |
| BOOLEAN | Equivalent to NUMERIC |
Date/Time Datatypes
All date or time datatypes in SQLite are converted to NUMERIC datatypes.
The following are the Date/Time Datatypes in SQLite:
| Data Type Syntax | Explanation |
|---|---|
| DATE | Equivalent to NUMERIC |
| DATETIME | Equivalent to NUMERIC |
| TIMESTAMP | Equivalent to NUMERIC |
| TIME | Equivalent to NUMERIC |
Large Object (LOB) Datatypes
The following are the LOB Datatypes in SQLite:
| Data Type Syntax | Explanation |
|---|---|
| BLOB | Equivalent to NONE |
[转]SQLite 经验集的更多相关文章
- [html]经验集
禁止默认的右键菜单: window.document.oncontextmenu = function(){ return false;} WebBrowser 控件用法:(手动填充内容) // 首先 ...
- [转]Oracle 经验集
-- 转换字符串为日期格式 to_date('2011-12-30 11:54:30','yyyy-MM-dd:hh24:mi:ss') Oracel 用 C# 连接,Microsoft 自带的 Sy ...
- [转]Windows 经验集
Windows Server 2012 R2 显示 这台电脑 图标方法: 来自:https://jingyan.baidu.com/article/f25ef2544f6883482c1b82e5.h ...
- [转][Dapper]SQL 经验集
condition.Append(" AND ChineseName like @name"); p.Add("@name", "%" + ...
- [java]经验集
Calendar c = Calendar.getInstance(); c.set(1999,12,21); SimpleDateFormat sdf = new SimpleDateFormat( ...
- [Java.web][eclipse]经验集
自动提示部分内容来自:http://www.cnblogs.com/mashuangying2016/p/6549991.html 使用 Eclipse 调试 Tomcat 的设置: Window - ...
- [转][c#]注册表经验集
在 win7 64位的系统中,为了将程序做成绿化版(单EXE文件),一些设置准备放到 regedit(注册表)中. 测试时发现网上的 demo 可以读,但写的值调试不报错,相应位置却不存在,困扰了许久 ...
- [转]加密经验集 => C#
下载地址 代码摘自 C#高级编程(第7版) 第579页 不对称加密
- [转]MySQL 经验集
-- my.ini -> 在 [mysqld] 节点下加入一行 skip-grant-tables 然后重启服务 -- 接下来无密码登录到 mysql 执行以下命令 use mysql show ...
随机推荐
- 用国内镜像源pip加速安装模块
记住,如果使用了virtualenv,一定要先workon进入虚拟环境再执行包安装命令. pip install -i https://pypi.douban.com/simple/ 模块名(如:dj ...
- Annotation方式实现AOP
1.添加其他jar包 2.配置applicationContext.xml文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <?xml version=&quo ...
- powershell -enc参数无法解码base64编码payload的解决方案
powershell的-enc参数允许传入一个base64编码过的powershell脚本字符串作为参数来执行该powershell脚本,该方法常被用于绕过杀毒软件的主动防御机制. 今天下午在做一个后 ...
- Android支持Split Apks后,如何获得指定包名下的所有类
从Android5.0以后,支持多个apk动态部署,这导致以前通过单一apk获取包路径下的所有类的方法失效,不过稍微修改一下原先的代码就可以,代码如下 public static final List ...
- CUDA Samples: green ball
以下CUDA sample是分别用C++和CUDA实现的生成的绿色的球图像,并对其中使用到的CUDA函数进行了解说,code参考了<GPU高性能编程CUDA实战>一书的第五章,各个文件内容 ...
- [置顶]
flume高并发优化——(15)中间件版本升级
在系统平稳运行一年的基础上,为提供更好的服务,现针对java,kafka,flume,zk,统一进行版本升级,请各位小伙伴跟着走起来,不要掉队啊! 名称 老版本号 新版本号 jdk 1.7.0_25 ...
- vue-one_demo_music
简单的音乐盒子 利用计算属性(监听数据),解决上一首,下一首,点击切换 <!DOCTYPE html> <html lang="en"> <head& ...
- Vmware无法正常打开
VMware的问题 VMware总是搞一些事情,比如隔三差五就打不开了.那么怎么办呢?以前总要把Vm的安装程序重新开始一遍,然后选择修复 但是呢?这样太麻烦了,前几月做web开发的时候接触了Apach ...
- 【剑指offer】07重建二叉树,C++实现
本博文是原创博文,转载请注明出处! # 本文为牛客网<剑指offer>刷题笔记 1.题目 # 输入某二叉树的前序遍历和中序遍历的结果,重建二叉树 2.思路(递归) # 前序遍历中,第一个数 ...
- ios逆向工程-动态分析
先说说为什么要分析应用吧,如果你想从一个ios应用中获取有用的信息,或者你想修改该应用的一些功能,前提当然是要先知道该app的逻辑和结构了. 动态分享工具比较少,我们先分析个简单的,全民工具Cycri ...