oracle的minus怎么使用?
minus在Oracle中表示兩個(gè)結(jié)果集的交集,也就是說(shuō)兩個(gè)條件都成立的集合,那在mssql中用and就可以了是吧!或者主外鍵
selectnamefromtable1a,table2bwherea.name=b.name
再或者把結(jié)果集a查出來(lái)再在a中按b的條件查:
SELECTA.*FROM#WANA,(
SELECT[NAME]FROM(SELECT*FROM#WANGROUPBY[NAME],[TIME])T
GROUPBY[NAME]HAVINGCOUNT([TIME])=(SELECTCOUNT(*)FROM(SELECT[TIME]FROM#WANGROUPBY[TIME])[TIME])
)B
WHEREA.[NAME]=B.[NAME]
ORDERBYA.[TIME],A.[NAME]