Re: [問題] SAS資料處理

看板Statistics作者 (歐吉桑留學生)時間15年前 (2009/02/24 01:55), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串13/19 (看更多)
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 ※ 引述《a15321 (a15321)》之銘言: : 請教各位前輩,我有一組資料 : group type 其他變數... : 100 A : 100 B : 101 A : 101 A : 101 B : 101 B : 102 A : 103 B : 104 A : 104 A : group有上萬組,type只有兩種, : 我想把資料整理成只剩下,「同一個group同時有A與B兩種type」的group : 也就是上面的data能整理成留下 : group type : 100 A : 100 B : 101 A : 101 A : 101 B : 101 B : 我目前想到的作法是 : 先以group排序,然後用 if First.group and Last.group then delete; : 就能刪除只有一組資料的group。 : 但剩下 同一個group裡數組資料都是A type或都是B type的部份 : 就不知道怎麼抓出來刪除了... : 可否請板上前輩們給點提示 感謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.167.170.118 ※ 編輯: liton 來自: 118.167.170.118 (02/24 01:59)

02/24 02:11, , 1F
可以請推薦幾本門SQL好書嗎?
02/24 02:11, 1F
文章代碼(AID): #19ekC4n1 (Statistics)
討論串 (同標題文章)
文章代碼(AID): #19ekC4n1 (Statistics)