Re: [問題] SAS資料處理
※ 引述《liton (歐吉桑留學生)》之銘言:
: Proc Sql;
: create table group as
: select group, type
: from source
: where group in
: (select group, count(distinct type) from source
: group by group
: having count(distinct type)>1);
: quit;
: 你很多類似問題..
: 建議你買本入門的SQL
感謝,但我跑出來是錯誤訊息 @@
ERROR: A subquery cannot select more than one column.
ERROR: A Composite expression (usually a subquery)
is used incorrectly in an expression.
馬上google惡補了一下一些基礎
請問這段如果改成這樣會是一樣嗎
PROC SQL;
CREATE TABLE new AS
SELECT group, type, COUNT(DISTINCT type)
FROM source
GROUP by group
HAVING COUNT(DISTINCT type)>1;
quit;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.150.51
討論串 (同標題文章)
本文引述了以下文章的的內容:
問題
1
1
以下文章回應了本文:
完整討論串 (本文為第 14 之 19 篇):
問題
1
3
問題
1
3
問題
1
1
問題
2
5
問題
1
1
問題
1
3
問題
1
2
問題
3
5