当前位置:网站首页>select如果不加order by子句,返回结果的顺序是不可靠的
select如果不加order by子句,返回结果的顺序是不可靠的
2022-07-28 09:57:00 【不爱说话的小张】
前言
最近的项目设计到迁移国产化环境的事情,今天才测试迁移金仓数据库后的功能时,意外发现select 查询语句如果不加order by 语句指定排序规则,那么它的查询结果的顺序是不可靠的,刚开始还以为是人大金仓数据库的原因,后来翻阅了资料才知道原来select如果不加order by子句,返回结果的顺序是不可靠的。它的存储引擎,是否迁移过,修改,和添加和是否有索引都会影响到结果的顺序。
提示:以下是本篇文章正文内容,下面案例可供参考
一、select 语句不加order by 子句,返回结果是不确定的?
再次就不做太多的演示了,有兴趣的可以自己观察一下。
二、使用步骤
1.查询语句
代码如下(示例):
select * from student
2.加order by 查询语句
代码如下(示例):
select * from student order by id
总结
因select 语句不加order by 子句,查询的结果顺序是不可靠的,所以你想排序,总是要加上order by的。
边栏推荐
- Experiment 5: user and user group management
- Data can't lie. Plato farm is the leader of the meta universe
- Plato farm - a farm meta universe game with Plato as the goal
- _HUGE and __IMP__HUGE in “math.h“
- 【Gradle】This version of the JMH Gradle plugin requires Gradle 6+, you are using 6.6.
- In hot weather, the line of defense for safe production was strengthened, and Guangzhou Haizhu District carried out emergency drills for gas stations
- PHP Basics
- B2B2C系统亮点是什么?如何助力珠宝首饰企业打造全渠道多商户商城管理体系
- The blind box of super primitive series will be launched soon, and platofarm will enable more rights and interests
- Weekly report on July 27, 2022
猜你喜欢

医药行业数字化建设,箭在弦上

Digital transformation scheme of real estate: all-round digital intelligence system operation, helping real estate enterprises improve the effectiveness of management and control

The blind box of super primitive series will be launched soon, and platofarm will enable more rights and interests

19. 删除链表的倒数第 N 个结点

Basic examples that must be mastered by beginners of C #

Why should I take the first-class constructor examination? How high is the gold content of the first-class Constructor Certificate?

我用小程序容器让移动研发效率提升了5倍!

选择供应商服务系统,是大健康产业企业迈向数字化转型的第一步

为什么要考一级建造师,一建证书含金量有多高?
![[ESP32][esp-idf] AP+STA实现无线桥接 中转wifi信号](/img/bf/0a968064a8f7c11b86a2a2820208e6.png)
[ESP32][esp-idf] AP+STA实现无线桥接 中转wifi信号
随机推荐
LSA and optimization of OSPF
【学习笔记】border与period
The blind box of super primitive series will be launched soon, and platofarm will enable more rights and interests
【JZOF】14剪绳子
Installing MySQL for Linux operating system (centos7)
uni-app进阶之创建组件/原生渲染
双指针技巧
并查集
Arthas tutorial
Bit.store, which has attracted much attention, is at a glance of the latest developments
Edge team explains how to improve the comprehensive performance experience through disk cache compression technology
【JZOF】15二进制中1的位数
Sizebasedtriggingpolicy introduction
Irregular area of OSPF, LSA and serial number
医药行业数字化建设,箭在弦上
vc链接静态库的时候要注意的问题
Being on duty less than 8 hours a day and being dismissed? Tencent's former employees recovered 13million overtime pay, etc., and the court won a compensation of 90000 in the final judgment
OSPF的拓展配置,选路原则,防环及重发布
JWT login authentication + token automatic renewal scheme, well written!
[OpenHarmony] [RK2206] 构建OpenHarmony编译器 (二)