我正在行使以下查询来查询在两列上有订单的DB.
SELECT a,b,c from Table1 Order By a asc,b asc;
我的题目是,排序是否担保不变(按尺度).固然它没有任何意义,但不不变,但我问这个,由于我在网上读到了
The standard does not prevent the use of a stable sort,but it also does not require it.
办理要领
这种排序不能担保不变.我以为SQL Server
documentation对怎样实现不变排序有一个很好的表明:
To achieve stable results between query requests using OFFSET and FETCH,the following conditions must be met: The underlying data that is used by the query must not change. That is,either the rows touched by the query are not updated or all requests for pages from the query are executed in a single transaction using either snapshot or serializable transaction isolation. For more information about these transaction isolation levels,see SET TRANSACTION ISOLATION LEVEL (Transact-SQL). The ORDER BY clause contains a column or combination of columns that are guaranteed to be unique.
领略排序不不变的最简朴要领是返回表的界说.表在SQL中本质上是无序的.因此,没有任何次序可以依赖“不变性”.
作为第二个思量身分,可以并行地实验分类.在大大都并行排序中,民众密钥被搜集在一路??而没有关于其原始次序的信息(除非在排序密钥中显式或隐式地实现). (编辑:湖南网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|