select * into #temp1 from tbl_sdk_volume where period_end = '2007/6/30' and (not ([backup] = 'Y' and amt_purc>=35 )) and country ='TAI' select * into #temp2 from tbl_sdk_volume where period_end = '2007/5/31' and ([backup] = 'Y' and amt_purc>=35 ) and country ='TAI' select * from #temp1 where sa_ss in (select sa_ss from #temp2)