minus在Oracle中表示两个结果集的交集,也就是说两个条件都成立的集合,那在mssql中用and就可以了是吧!或者主外键
selectnamefromtable1a,table2bwherea.name=b.name
再或者把结果集a查出来再在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]