I can't figure out why these two counting queries should give me different results:declare @Tmp table(String varchar(50))insert into @Tmp (String)select 'a10'union allselect 'a09'union allselect 'a08'select count(distinct(c.id)) as 'select * from @Tmp'from Db1.dbo.Table1 as cwhere c.name in (select * from @Tmp) --use subqueryand c.orderstatusname in ('Shipped','Taken','Back-Ordered')and c.OrderType = 'Regular'select count(distinct(c.id)) as 'a08,a09,a10'from Db1.dbo.Table1 as cwhere c.name in ('a08','a09','a10') --use expression [OR]and c.orderstatusname in ('Shipped','Taken','Back-Ordered')and c.OrderType = 'Regular'I get a higher number from the first query.