if exists (select * from sysobjects where name=”usp_GuestRecordAllInfo”)
drop proc usp_GuestRecordAllInfo
go
create proc usp_GuestRecordAllInfo
as
select GuestName,IdentityID,ResideDate,Deposit,ResideName,LeaveDate,rr.RoomId,TypeID
from dbo.GuestRecord g
inner join dbo.ResideState r on g.ResideID=r.ResideId
inner join dbo.Room rr on rr.RoomId=g.RoomId
inner join dbo.RoomType t on t.TypeId=rr.RoomTypeId
go
这个里面的TypeId 怎么能绑定到数据上面去?
drop proc usp_GuestRecordAllInfo
go
create proc usp_GuestRecordAllInfo
as
select GuestName,IdentityID,ResideDate,Deposit,ResideName,LeaveDate,rr.RoomId,TypeID
from dbo.GuestRecord g
inner join dbo.ResideState r on g.ResideID=r.ResideId
inner join dbo.Room rr on rr.RoomId=g.RoomId
inner join dbo.RoomType t on t.TypeId=rr.RoomTypeId
go
这个里面的TypeId 怎么能绑定到数据上面去?
解决方案
5
数据源只有一个
15
你试试用 LEFT OUT JOIN,并且加载 rr 表的 RoomTypeId 和 r 表的其他某个字段,看看能否 JOIN 上了
left outer join dbo.RoomType t on rr.RoomTypeId = t.TypeId