语法错误“接近1”。如果我删除TOP1,我在{@ 1}}附近也会收到错误。建议?
where
答案 0 :(得分:1)
无需exec
DECLARE @MainHospital varchar(50) = 'Hospital1'
select TOP 1 p.providerid, p.NAME, c.ClientType
from providers p
inner join hcfa_1450_main i on p.ProviderID=i.ProviderID
left outer join ClientTypes c on i.ClientTypeID = c.ClientTypeID
--where c.ClientType is not null
where p.NAME = @MainHospital
order by p.providerid