由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请教proc sql
相关主题
SAS Proc SQL count问题SAS Code 求助,如何把在另一个dataset的id找出来
问个sql问题SQL find distinct values in large table (转载)
问一个proc sql的问题,多谢Help on a SAS question
SAS 问题问几题sas adv, 多谢了!
完全不懂SAS,急请教一个问题SAS code help
sas问题Sas advance chapter quiz 一问
请问SAS大牛一个关于proc sql join请教一个SAS code
我的SAS CODE 错那儿了?求助, 读取大型数据的问题
相关话题的讨论汇总
话题: distinct话题: nm话题: create话题: proc话题: select
进入Statistics版参与讨论
1 (共1页)
g*******y
发帖数: 380
1
下面的程序有什么问题?
proc sql;
create table a1 as select r_year, distinct code, local_nm
from climate
;
quit;
我想把'code'和'local_nm'是unique的列出来,同时显示对应的年份.
下面的程序是work的:
proc sql;
create table a1 as select distinct code, local_nm
from climate
;
quit;
但是我加入r_year,就出现一下提示:
214 create table a1 as select r_year, distinct code, local_nm
----
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *
C******t
发帖数: 72
2
Try to move the distinct next to select:
proc sql;
create table a1 as select distinct r_year, code, local_nm
from climate
;
g*******y
发帖数: 380
3
谢谢,但是我只需要distinct code and local_nm, 我需要r_year只是起个定位作用,并
不需要 distinct r_year.

【在 C******t 的大作中提到】
: Try to move the distinct next to select:
: proc sql;
: create table a1 as select distinct r_year, code, local_nm
: from climate
: ;

g*******y
发帖数: 380
4
自己顶一下.
f********t
发帖数: 117
5
it doesnt look like sas has distinct on ()
so I guess you can try to create
proc sql;
create temp table a1 as select distinct code, local_nm
from climate;
create table a2 as select a1.code, a1.local_nm, c.r_year from a1, climate c
where a1.code = c.code, a1.local_nm = c.local_nm;
quit;
I dont have sas to test, so you can try it.
p********a
发帖数: 5352
6
很明显对DISTINCT没搞清除嘛。
1 (共1页)
进入Statistics版参与讨论
相关主题
求助, 读取大型数据的问题完全不懂SAS,急请教一个问题
请教SAS SQLsas问题
compare two large tables SQL (转载)请问SAS大牛一个关于proc sql join
问个SAS的问题我的SAS CODE 错那儿了?
SAS Proc SQL count问题SAS Code 求助,如何把在另一个dataset的id找出来
问个sql问题SQL find distinct values in large table (转载)
问一个proc sql的问题,多谢Help on a SAS question
SAS 问题问几题sas adv, 多谢了!
相关话题的讨论汇总
话题: distinct话题: nm话题: create话题: proc话题: select