当前位置:网站首页>SQLite 3.39.0 发布,支持右外连接和全外连接
SQLite 3.39.0 发布,支持右外连接和全外连接
2022-07-02 18:37:00 【不剪发的Tony老师】
大家好,我是只谈技术不剪发的 Tony 老师。
SQLite 开发团队于 2022 年 06 月 25 日发布了 SQLite 3.39.0 版本。该版本最大的更新就是支持 RIGHT OUTER JOIN 和 FULL OUTER JOIN,本文给大家逐一进行分析。
如果觉得文章有用,欢迎评论、点赞、推荐
右外连接和全外连接
一直以来,SQLite 都不支持右外连接和全外连接,SQLite 3.39.0 终于弥补上了这个缺陷。至此,SQLite 提供了 SQL 标准中所有的 JOIN 方式,MySQL 需要加油了。
来看一个简单的示例:
sqlite> select sqlite_version();
3.39.0
sqlite> create table t1(id int);
sqlite> insert into t1 values(1),(2),(3);
sqlite> create table t2(id int, name text);
sqlite> insert into t2 values(1, 'one'),(4, 'four');
sqlite> select * from t1 left join t2 on t1.id=t2.id;
1|1|one
2||
3||
sqlite> select * from t2 right join t1 on t1.id=t2.id;
1|one|1
||2
||3
sqlite> select * from t1 full join t2 on t1.id=t2.id;
1|1|one
2||
3||
|4|four
IS [NOT] DISTINCT FROM
SQLite 3.39.0 还增加了两个新的二进制比较运算符:IS NOT DISTINCT FROM 和 IS DISTINCT FROM。
IS NOT DISTINCT FROM 等价于 IS 运算符,它们都和 = 运算符类似,但是支持 NULL 值的比较。例如:
sqlite> select 1=1, 1 IS 1, 1 IS NOT DISTINCT FROM 1;
1|1|1
sqlite> select NULL=NULL, NULL IS NULL, NULL IS NOT DISTINCT FROM NULL;
|1|1
与此类似,IS DISTINCT FROM 等价于 IS NOT 运算符。
新增的两个运算符和 SQL 标准以及 PostgreSQL 实现兼容。
C 接口增强
接口 sqlite3_vtab_distinct() 新增了一个返回码(3),表示查询同时使用了 DISTINCT 以及 ORDER BY 子句。
增加了一个新的接口 sqlite3_db_name(),用于返回数据库连接中的数据库名。
其他增强
UNIX 操作系统接口会在文件打开之前解析文件名中的所有符号链接,从而为数据库创建一个标准名称。
延迟视图的物化操作,直到真正需要时才物化,从而避免不必要的工作。
任何聚合查询中都可以使用 HAVING 子句,即使查询中没有 GROUP BY 子句。在之前的版本中,HAVING 子句必须和 GROUP BY 子句配套使用,不能单独出现。
大量微优化使得 CPU 周期整体减少了约 2.3%。
边栏推荐
- 中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
- 4274. Suffix expression - binary expression tree
- Data dimensionality reduction principal component analysis
- 注解开发方式下AutowiredAnnotationBeanPostProcessor的注册时机
- 机器学习笔记 - 时间序列预测研究:法国香槟的月销量
- 搭建主从模式集群redis
- SIFT特征点提取「建议收藏」
- 虚拟机初始化脚本, 虚拟机相互免秘钥
- Reading notes of "the way to clean structure" (Part 2)
- Excel finds the same value in a column, deletes the row or replaces it with a blank value
猜你喜欢
AcWing 340. 通信线路 题解(二分+双端队列BFS求最短路)
AcWing 342. Road and route problem solving (shortest path, topological sorting)
[error record] problems related to the installation of the shuttle environment (follow-up error handling after executing the shuttle doctor command)
Bubble sort array
Data dimensionality reduction factor analysis
Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly
High frequency interview questions
《重构:改善既有代码的设计》读书笔记(下)
Talk about the design of red envelope activities in e-commerce system
Data dimensionality reduction principal component analysis
随机推荐
Data dimensionality reduction principal component analysis
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 網絡安全專家 NSE 5
Windows2008R2 安装 PHP7.4.30 必须 LocalSystem 启动应用程序池 不然500错误 FastCGI 进程意外退出
股票证券公司排名,有安全保障吗
mybatiesHelperPro工具必须的可以生成到对应项目文件夹下
AcWing 341. 最优贸易 题解 (最短路、dp)
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
高级性能测试系列《24. 通过jdbc执行sql脚本》
According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors
云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
Idea editor removes SQL statement background color SQL statement warning no data sources are configured to run this SQL And SQL dialect is not config
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
AcWing 343. 排序 题解(floyd性质实现传递闭包)
Juypter notebook modify the default open folder and default browser
metric_logger小解
Windows2008r2 installing php7.4.30 requires localsystem to start the application pool, otherwise 500 error fastcgi process exits unexpectedly
思考变量引起的巨大变化
Py之interpret:interpret的简介、安装、案例应用之详细攻略
Advanced performance test series "24. Execute SQL script through JDBC"
《重构:改善既有代码的设计》读书笔记(下)