sql-server - SQL Server如何确定row_number中order by子句中未使用的其他列的顺序
问题描述
我必须row_number
基于一个col1生成,所以我在col1上使用order by,但是对应的col2是如何排序的,总是相同的顺序还是不同的顺序?
下面的例子:
create table #2 (id int, user_id int, building varchar(10))
insert into #2 (id, user_id, building)
select 1,11,'First'
union all
select 2,13,'First'
union all
select 3,12,'First'
union all
select 4,15,'Second'
union all
select 5, 14,'Second'
select
*,
row_number() over (order by building)
from #1
user_id
列的顺序是如何确定的?
解决方案
推荐阅读
- azure-devops - 限制同时 Azure Pipelines 阶段
- python - 在python中查找函数的根
- ios - 如何将数据添加到 tableView 并重新加载?
- sql-server - SSRS 共享数据无法连接某些报表
- websocket - esp8266 websockets type == WStype_TEXT 总是假的,即使你正在发送数据
- python - 我想根据索引号将我的大列表分成多个列表,Python
- google-data-studio - 来自 Data Studio 和 Google Search Console 的不同数据
- websocket - 重新连接间隔
- docker - Docker 将容器卷挂载为只读
- rgb - 是否有根据图像中的样本校正图像中 RGB 的公式?