看板 Statistics 關於我們 聯絡資訊
proc sql; create table abc2 as select * from abc where code not in ( select code from abc where roe = . ); select count(distinct code) as 公司數 from 第二小題的資料; quit; ※ 引述《bugle (低點)》之銘言: : proc sql; : create table work.temp as : select * : from abc : where code in ( : select code, count(case when roe = . then 1 else 0 end) as cnt : from abc : group by 1 : having cnt = 0 : ) : ; : quit; 另外 b 大的這支程式好像會出現: ERROR: A subquery cannot select more than one column. ERROR: A Composite expression (usually a subquery) is used incorrectly in an expression. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.241.14.158 ※ 編輯: KnightX 來自: 210.241.14.158 (04/29 17:17)
bugle:sorry函數下錯了, count請改為sum 04/29 19:53
iinnttww:感謝阿~~看來SQL真的很方便 05/13 08:11