select语句的问题
select T_warhouse.Warnumber as Warnumber,T_manager.managernumber as manager,T_manager.managername as managername,T_part.Partype as Partype
into #temp2
from T_warhouse left outer join T_manager on T_warhouse.Warnumber=T_manager.Warnumber
left outer join T_part on T_manager.Warnumber=T_part.Warnumber
select distinct * from #temp2
请问这两个select语句怎么合成一句呀!!
[解决办法]
你的什么意思?
你的第一句造了#temp2
你的第二句是查询#temp2
[解决办法]
这样就可以了[code=sql
select * from
(select T_warhouse.Warnumber as Warnumber,T_manager.managernumber as manager,T_manager.managername as managername,T_part.Partype as Partype
[code=sqlfrom T_warhouse left outer join T_manager on T_warhouse.Warnumber=T_manager.Warnumber
left outer join T_part on T_manager.Warnumber=T_part.Warnumber
)][/code]
[解决办法]
select distinct T_warhouse.Warnumber as Warnumber,T_manager.managernumber as manager,T_manager.managername as managername,T_part.Partype as Partype
from T_warhouse left outer join T_manager on T_warhouse.Warnumber=T_manager.Warnumber
left outer join T_part on T_manager.Warnumber=T_part.Warnumber