[转]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 ...
随机推荐
- gzip压缩解压缩
压缩/解压缩压缩/解压缩之后的文件名称 必须是gz 解压缩
- CMDB后台管理(AutoServer)
1.表结构设计 from django.db import models class UserProfile(models.Model): """ 用户信息 " ...
- 【javascript基础】 JavaScript defer和async区别
defer该属性用来通知浏览器,这段脚本代码将不会产生任何文档内容.例如 JavaScript代码中的document.write()方法将不会骑作用,浏览器遇到这样的代码将会忽略,并继续执行后面的代 ...
- mysql服务1067错误:修改mysql可执行文件路径
今天遇到mysql服务1067错误的问题,设置使用系统账户也无法启动mysql,后面认证看了系统的配置信息,发现启动文件也就是mysql安装路径是之前的(也说明之前安装mysql,没去卸载直接安装新的 ...
- 不用storyboard,用xib开发
1. 新建一个Single View Application项目, 删除自动生成的.storyboard文件和ViewController文件 2. 新建一个UIViewController的子类,命 ...
- 201621123005《Java程序设计》第三周作业学习总结
201621123005<Java程序设计>第三周 学习总结 标签(空格分隔): 未分类 1. 本周学习总结 初学面向对象,会学习到很多碎片化的概念与知识.尝试学会使用思维导图将这些碎片化 ...
- win10 downloader.exe 修复方法
由于系统更新是和系统密切相关的,在日常使用中某些系统文件如果出现损坏,同样会导致系统更新无法成功安装.如果在使用Windows 10时可以成功下载更新,但是安装的时候出错,此时就需要对系统文件进行检查 ...
- shell脚本实例一
一. 什么是shell 脚本时一种解释性语言: shell脚本保存执行动作: 脚本判定命令的执行条件 脚本来实现动作的批量执行.二.如何创建 vim test.sh ##shell脚本一般都 ...
- 如何规划和选择数据库服务器:CPU、内存、磁盘、网络(转)
转自:http://blog.chinaunix.net/uid-5715-id-2734517.html 学习如何根据业务模型来计算tpcc值,挺有帮助的. 当一个新的业务系统开发完成后,需要在一个 ...
- SAP NetWeaver Business Client (NWBC) 简介
1.NWBC 简介 SAP NetWeaver Business Client (NWBC) 是新一代SAP用户界面,集成了SAPGUI事务和新的web dynpro应用,类似于桌面应用程序. SAP ...