由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS问题:Sorting若有相同的key,问题1,2
相关主题
which route in SAS is faster?弱问PROC SQL,SQL,Data Step和SAS的区别和关系
请教 2 道SAS Adv 真题SQL database tool是指哪些东西 (转载)
急!SAS adv的一道题,谢谢!再问道SAS的题目
请教SAS ADV一道题![合集] 问个SAS和R的问题
question about r code "order"请教一个sas的基本问题
help with a simple sas questionSAS - please help!
[转载] Re: SAS plot problemSAS memory management
sas的sql语法怎么用SAS sort 50G的data
相关话题的讨论汇总
话题: order话题: sql话题: equals话题: clause话题: rows
进入Statistics版参与讨论
1 (共1页)
v*******e
发帖数: 11604
1
问题1已经解决;底下还有问题2;
问题1, 比如一个data set, 这样的:
A B date
Li Wang 2011
Wang Li 2011
那么我对date排序,排出来顺序是怎样的?有规定吗?SAS9.2和9.3的结果有没有可能
是不同的?
问题2, 同样一个date set, 用proc sql来sort,
proc sql;
create table myresult
as select A, B, date
from mydataset
order by date;
;
quit;
排出来顺序是怎样的?有规定吗?SAS9.2和9.3的结果有没有可能是不同的?
p********a
发帖数: 5352
2
保持TABLE里原来的顺序,和SAS版本无关。
v*******e
发帖数: 11604
3
谢谢,看了documentation, 有这个option, default是EQUALS
EQUALS | NOEQUALS
specifies the order of the observations in the output data set. For
observations with identical BY-variable values, EQUALS maintains the
relative order of the observations within the input data set in the output
data set. NOEQUALS does not necessarily preserve this order in the output
data set.
Default: EQUALS
v*******e
发帖数: 11604
4
看了doc, 似乎用proc sql排序,首楼例子的结果是不定的。9.3的doc:
The order of the output rows that are returned is guaranteed only for
columns that are specified in the ORDER BY clause.
Note: The ORDER BY clause does not guarantee that the order of the rows
generated is deterministic. The ANSI standard for SQL allows the SQL
implementation to specify whether the ORDER BY clause is stable or unstable.
If the joint combination of values that is referenced in an ORDER BY clause
for a query are unique in all of the rows that are being ordered, then the
order of rows that is generated by ORDER BY is always deterministic. However
, if the ORDER BY clause does not reference a joint combination of unique
values, then the order of rows is not deterministic if ORDER BY is unstable.
1 (共1页)
进入Statistics版参与讨论
相关主题
怎么用SAS sort 50G的dataquestion about r code "order"
求教一道SAS题: 如何比较区间help with a simple sas question
How to sort the columns in SAS?[转载] Re: SAS plot problem
求救:SAS programmer面试题!sas的sql语法
which route in SAS is faster?弱问PROC SQL,SQL,Data Step和SAS的区别和关系
请教 2 道SAS Adv 真题SQL database tool是指哪些东西 (转载)
急!SAS adv的一道题,谢谢!再问道SAS的题目
请教SAS ADV一道题![合集] 问个SAS和R的问题
相关话题的讨论汇总
话题: order话题: sql话题: equals话题: clause话题: rows