create table #tempCompanyTable
(
rownum int IDENTITY (1, 1) Primary key NOT NULL,
CompanyId bigint
)
create table CompanyTable(companyid bigint)
insert into CompanyTable(companyid)
select '111'
union all select '222'
union all select '4455'
union all select '678'
insert #tempCompanyTable
(
CompanyId
)
select CompanyID from CompanyTable where 1=1
--(所影响的行数为 4 行)
然后再查
select CompanyID from CompanyTable where 1=1
--(所影响的行数为 4 行)
与
select CompanyID from #tempCompanyTable
--(所影响的行数为 4 行)