看板 Statistics 關於我們 聯絡資訊
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)
ayung0508:可以請推薦幾本門SQL好書嗎? 02/24 02:11