insert into #tb_temp2(fnumber,fname)
select T_BC_ExpenseType.FNumber,T_BC_ExpenseType.FName_L2
from T_BC_ExpenseType inner join (select distinct SUBSTRING(fnumber,1,7) as fnumber from #tb_temp2) as #tb_temp3
on T_BC_ExpenseType.FID=#tb_temp3.fnumber
(select distinct SUBSTRING(fnumber,1,7) as fnumber from #tb_temp2) as #tb_temp3
这一句有多个值
整个sql的意思是获取费用类型的上级然后插入到#tb_temp2中
改成in 也不行
insert into #tb_temp2(fnumber,fname)
select T_BC_ExpenseType.FNumber,T_BC_ExpenseType.FName_L2
from T_BC_ExpenseType where FNumber in (select distinct SUBSTRING(fnumber,1,7) as fnumber from #tb_temp2)
解决了,是其他sql出错,感谢关注